-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathMakefile
107 lines (83 loc) · 2.76 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
REPO ?= stanchion
PKG_REVISION ?= $(shell git describe --tags)
PKG_VERSION ?= $(shell git describe --tags | tr - .)
PKG_ID = stanchion-$(PKG_VERSION)
PKG_BUILD = 1
BASE_DIR = $(shell pwd)
ERLANG_BIN = $(shell dirname $(shell which erl))
REBAR ?= $(BASE_DIR)/rebar
OVERLAY_VARS ?=
.PHONY: rel deps test
all: deps compile
compile: deps
@(./rebar compile)
deps:
@./rebar get-deps
clean:
@./rebar clean
distclean: clean
@./rebar delete-deps
@rm -rf $(PKG_ID).tar.gz
parity-test:
@python test/prototype_parity.py -v
##
## Release targets
##
rel: deps compile
@./rebar compile
@./rebar skip_deps=true generate $(OVERLAY_VARS)
relclean:
rm -rf rel/stanchion
##
## Developer targets
##
stage : rel
$(foreach dep,$(wildcard deps/*), rm -rf rel/stanchion/lib/$(shell basename $(dep))-* && ln -sf $(abspath $(dep)) rel/stanchion/lib;)
$(foreach app,$(wildcard apps/*), rm -rf rel/stanchion/lib/$(shell basename $(app))-* && ln -sf $(abspath $(app)) rel/stanchion/lib;)
devrel: all
mkdir -p dev
@./rebar skip_deps=true generate target_dir=../dev/$(REPO) \
overlay_vars=dev_vars.config
stagedevrel: devrel
$(foreach app,$(wildcard apps/*), rm -rf dev/$(REPO)/lib/$(shell basename $(app))* && ln -sf $(abspath $(app)) dev/$(REPO)/lib;)
$(foreach dep,$(wildcard deps/*), rm -rf dev/$(REPO)/lib/$(shell basename $(dep))* && ln -sf $(abspath $(dep)) dev/$(REPO)/lib;)
devclean: clean
rm -rf dev
##
## Doc targets
##
orgs: orgs-doc orgs-README
orgs-doc:
@emacs -l orgbatch.el -batch --eval="(riak-export-doc-dir \"doc\" 'html)"
orgs-README:
@emacs -l orgbatch.el -batch --eval="(riak-export-doc-file \"README.org\" 'ascii)"
@mv README.txt README
DIALYZER_APPS = kernel stdlib sasl erts ssl tools os_mon runtime_tools crypto inets \
xmerl webtool eunit syntax_tools compiler
PLT ?= $(HOME)/.stanchion_dialyzer_plt
##
## Packaging targets
##
.PHONY: package
export PKG_VERSION PKG_ID PKG_BUILD BASE_DIR ERLANG_BIN REBAR OVERLAY_VARS RELEASE
package.src: deps
mkdir -p package
rm -rf package/$(PKG_ID)
git archive --format=tar --prefix=$(PKG_ID)/ $(PKG_REVISION)| (cd package && tar -xf -)
${MAKE} -C package/$(PKG_ID) deps
mkdir -p package/$(PKG_ID)/priv
git --git-dir=.git describe --tags >package/$(PKG_ID)/priv/vsn.git
for dep in package/$(PKG_ID)/deps/*; do \
echo "Processing dep: $${dep}"; \
mkdir -p $${dep}/priv; \
git --git-dir=$${dep}/.git describe --tags >$${dep}/priv/vsn.git; \
done
find package/$(PKG_ID) -depth -name ".git" -exec rm -rf {} \;
tar -C package -czf package/$(PKG_ID).tar.gz $(PKG_ID)
dist: package.src
cp package/$(PKG_ID).tar.gz .
package: package.src
${MAKE} -C package -f $(PKG_ID)/deps/node_package/Makefile
pkgclean: distclean
rm -rf package
include tools.mk