forked from cabol/shards
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
61 lines (44 loc) · 1.07 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
REBAR = $(shell which rebar3)
EPMD_PROC_NUM = $(shell ps -ef | grep epmd | grep -v "grep")
.PHONY: all compile clean distclean test qc test_suite covertool dialyzer xref check shell docs
all: check_rebar compile
compile: check_rebar
$(REBAR) compile
clean: check_rebar
rm -rf ebin/* test/*.beam logs log
$(REBAR) clean
distclean: clean
$(REBAR) clean --all
rm -rf _build logs log doc *.dump *_plt *.crashdump priv
dialyzer: check_rebar
$(REBAR) dialyzer
xref: check_rebar
$(REBAR) xref
test: check_rebar
$(REBAR) do proper, ct, cover
qc: check_rebar
$(REBAR) do proper
test_suite: check_rebar
$(REBAR) do ct --suite=test/$(SUITE)_SUITE, cover
covertool: check_rebar
$(REBAR) as test covertool generate
docs: check_rebar
$(REBAR) edoc
check: test covertool dialyzer xref docs
@echo "OK!"
shell: check_rebar
$(REBAR) shell
check_rebar:
ifeq ($(REBAR),)
ifeq ($(wildcard rebar3),)
$(call get_rebar)
else
$(eval REBAR=./rebar3)
endif
endif
define get_rebar
curl -O https://s3.amazonaws.com/rebar3/rebar3
chmod a+x rebar3
./rebar3 update
$(eval REBAR=./rebar3)
endef