forked from cabol/erlbus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
75 lines (57 loc) · 1.55 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
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 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
test: check_rebar check_epmd check_plt
$(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
## The option '--readable=false' is added due to the compatibility issue of rebar3 with OTP 21
ci: check_epmd check_plt
$(call get_rebar)
$(REBAR) do ct --suite=$(LOCAL_SUITES) --readable=false, cover
rm -rf rebar3
shell: check_rebar
$(REBAR) shell
doc: check_rebar
$(REBAR) edoc
check_rebar:
ifeq ($(REBAR),)
ifeq ($(wildcard rebar3),)
$(call get_rebar)
else
$(eval REBAR=./rebar3)
endif
endif
check_plt:
ifeq (,$(wildcard ./*_plt))
@echo " ---> Running dialyzer ..."
$(REBAR) dialyzer
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