-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
96 lines (73 loc) · 2.2 KB
/
Makefile
File metadata and controls
96 lines (73 loc) · 2.2 KB
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
ERLC?= erlc
CURRENT=$(shell pwd)
BUILDDIR=$(CURRENT)/build
SUPPORT_DIR=$(CURRENT)/support
ESCRIPT=escript
DIALYZER=dialyzer
all: clean compile
compile: get-deps
@cp -R $(CURRENT)/apps $(BUILDDIR)/apps
@echo "==> build coffer"
@(cd $(BUILDDIR) && \
$(ESCRIPT) rebar -C $(CURRENT)/rebar.config compile || exit 0)
clean:
@(test -d $(BUILDDIR) && \
cd $(BUILDDIR) && \
$(ESCRIPT) rebar -C $(CURRENT)/rebar.config clean || exit 0)
rel:
@rm -rf rel/coffer
@$(ESCRIPT) $(BUILDDIR)/rebar generate
.PHONY: rel
dev: get-deps
@(cd $(BUILDDIR) && \
test ! -d $(BUILDDIR)/apps && ln -s $(CURRENT)/apps . || exit 0)
@echo "==> build coffer"
@(cd $(BUILDDIR) && \
$(ESCRIPT) rebar -v -C $(CURRENT)/rebar.config compile || exit 0)
devclean:
@(cd $(BUILDDIR) && \
$(ESCRIPT) rebar -C $(CURRENT)/rebar.config clean || exit 0)
distclean: clean rebarclean
@rm -rf $(BUILDDIR)
dialyze: dialyzer.plt
@(cd $(BUILDDIR) && \
$(DIALYZER) --plt $(CURRENT)/dialyzer.plt -I \
apps/coffer_blobserver/ebin/ \
apps/coffer_common/ebin/ \
apps/coffer/ebin/ \
deps/cowboy/ebin/ \
deps/ranch/ebin/ \
deps/jsx/ebin/ \
deps/goldrush/ebin/ \
deps/lager/ebin/ || exit 0)
dialyzer: dialyze
dialyzer.plt:
$(DIALYZER) --build_plt --output_plt dialyzer.plt \
--apps erts kernel stdlib mnesia crypto inets xmerl sasl \
compiler debugger ssl tools
xref:
@(cd $(BUILDDIR) && \
$(ESCRIPT) rebar -C $(CURRENT)/rebar_test.config xref || exit 0)
test:
@(cd $(BUILDDIR) && \
$(ESCRIPT) rebar -C $(CURRENT)/rebar_test.config ct && \
$(ESCRIPT) rebar -C $(CURRENT)/rebar_test.config eunit || exit 0)
.PHONY: test
get-deps: rebar
@mkdir -p $(BUILDDIR)
@(cd $(BUILDDIR) && \
$(ESCRIPT) rebar -C $(CURRENT)/rebar.config get-deps)
update-deps: rebar
@(cd $(BUILDDIR) && \
$(ESCRIPT) rebar -C $(CURRENT)/rebar.config update-deps)
rebar:
@mkdir -p $(BUILDDIR)
@(test ! -e $(CURRENT)/support/rebar/rebar && \
echo "==> build rebar" && \
cd $(CURRENT)/support/rebar && \
$(ESCRIPT) bootstrap || exit 0)
@cp $(CURRENT)/support/rebar/rebar $(BUILDDIR)/rebar
rebarclean:
@(cd $(CURRENT)/support/rebar && \
rm -rf rebar ebin/*.beam inttest/rt.work rt.work .test)
.PHONY: rebar