-
Notifications
You must be signed in to change notification settings - Fork 60
/
Makefile
66 lines (49 loc) · 1.27 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
REBAR = $(shell which rebar3)
EPMD_PROC_NUM = $(shell ps -ef | grep epmd | grep -v "grep")
LOCAL_SUITES = "test/ebus_ps_SUITE,test/ebus_ps_local_SUITE,test/ebus_handler_SUITE"
.PHONY: all check_rebar compile clean distclean dialyzer xref test shell doc
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 check_epmd
$(REBAR) do ct --name [email protected], cover
rm -rf test/*.beam
local_test: check_rebar check_epmd
$(REBAR) do ct --suite=$(LOCAL_SUITES), cover
rm -rf test/*.beam
dist_test: check_rebar check_epmd
$(REBAR) do ct --name [email protected] --suite=test/ebus_dist_SUITE, cover
rm -rf test/*.beam
shell: check_rebar
$(REBAR) shell
docs: check_rebar
$(REBAR) ex_doc
check_rebar:
ifeq ($(REBAR),)
ifeq ($(wildcard rebar3),)
$(call get_rebar)
else
$(eval REBAR=./rebar3)
endif
endif
check_epmd:
ifeq ($(EPMD_PROC_NUM),)
epmd -daemon
@echo " ---> Started epmd!"
endif
define get_rebar
curl -O https://s3.amazonaws.com/rebar3/rebar3
chmod a+x rebar3
./rebar3 update
$(eval REBAR=./rebar3)
endef