-
Notifications
You must be signed in to change notification settings - Fork 9
/
Makefile
88 lines (62 loc) · 2.02 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
ARCH= $(shell uname -m)
REPO=rcouch
RCOUCH_TAG= $(shell git describe --tags --always)
REVISION?= $(shell echo $(RCOUCH_TAG) | sed -e 's/^$(REPO)-//')
PKG_VERSION?= $(shell echo $(REVISION) | tr - .)
WITHOUT_CURL?=1
REBAR?=./rebar
DESTDIR?=
DISTDIR= rel/archive
.PHONY: rel deps
all: deps compile
compile:
@WITHOUT_CURL=$(WITHOUT_CURL) $(REBAR) compile
deps:
@$(REBAR) get-deps
clean: rcouchxclean
@$(REBAR) clean
distclean: clean relclean
@$(REBAR) delete-deps
rel: relclean deps
@WITHOUT_CURL=$(WITHOUT_CURL) $(REBAR) compile generate
relclean:
@rm -rf rel/rcouch
##
## release tarbals
##
archive = git archive --format=tar --prefix=$(1)/ HEAD | (cd $(2) && tar xf -)
buildtar = mkdir distdir && \
git clone . distdir/rcouch-clone && \
cd distdir/rcouch-clone && \
git checkout $(RCOUCH_TAG) && \
$(call archive,$(RCOUCH_TAG),..) && \
mkdir ../$(RCOUCH_TAG)/deps && \
make deps; \
for dep in deps/*; do \
cd $${dep} && \
$(call archive,$${dep},../../../$(RCOUCH_TAG)) && \
mkdir -p ../../../$(RCOUCH_TAG)/$${dep}/priv && \
git rev-list --max-count=1 HEAD > ../../../$(RCOUCH_TAG)/$${dep}/priv/git.vsn && \
cd ../..; done
distdir:
$(if $(RCOUCH_TAG), $(call buildtar), $(error "You can't generate a release tarball from a non-tagged revision. Run 'git checkout <tag>', then 'make dist'"))
dist $(RCOUCH_TAG).tar.gz: distdir
cd distdir; \
tar czf ../$(RCOUCH_TAG).tar.gz $(RCOUCH_TAG)
package: dist
$(MAKE) -C package package
pkgclean:
$(MAKE) -C package pkgclean
rcouchx: rel rcouchxbuild
rcouchxbuild: rcouchxclean
@cp -R contrib/rcouchx rcouchx-build
@xcodebuild -project contrib/rcouchx/rcouchx.xcodeproj
@cp -R contrib/rcouchx/build/Release/rcouchx.app .
rcouchxclean:
@xcodebuild -project contrib/rcouchx/rcouchx.xcodeproj clean
@rm -rf contrib/rcouchx/build
@rm -rf rcouchx.app
rcouchxdmg: dist
$(MAKE) -C package rcouchx
.PHONY: package
export PKG_VERSION REPO REVISION RCOUCH_TAG