File tree Expand file tree Collapse file tree 2 files changed +18
-7
lines changed
Expand file tree Collapse file tree 2 files changed +18
-7
lines changed Original file line number Diff line number Diff line change 1- REBAR = $(shell which rebar3 || echo ./rebar3 )
1+ REBAR = $(shell which rebar3)
22
33# # Common variables
44CONFIG ?= test/test.config
@@ -11,25 +11,36 @@ CT_BUILD_PATH = $(CT_PATH)/lib/*/ebin
1111CT_SUITES = task_SUITE local_SUITE dist_SUITE
1212CT_OPTS = -cover test/cover.spec -erl_args -config ${CONFIG}
1313
14- .PHONY : all compile clean distclean dialyze tests shell doc
14+ .PHONY : all check_rebar compile clean distclean dialyze tests shell doc
1515
16- all : compile
16+ all : check_rebar compile
1717
18- compile :
18+ check_rebar :
19+ ifeq ($(REBAR ) ,)
20+ ifeq ($(wildcard rebar3) ,)
21+ curl -O https://s3.amazonaws.com/rebar3/rebar3
22+ chmod a+x rebar3
23+ $(eval REBAR=./rebar3)
24+ else
25+ $(eval REBAR=./rebar3)
26+ endif
27+ endif
28+
29+ compile : check_rebar
1930 $(REBAR ) compile
2031
21- clean :
32+ clean : check_rebar
2233 rm -rf ebin/* test/* .beam logs log
2334 $(REBAR ) clean
2435
2536distclean : clean
2637 $(REBAR ) clean --all
2738 rm -rf _build logs log edoc * .dump c_src/* .o priv/* .so
2839
29- dialyze :
40+ dialyze : check_rebar
3041 $(REBAR ) dialyzer
3142
32- tests :
43+ tests : check_rebar
3344 $(REBAR ) as test compile
3445 mkdir -p $(CT_PATH ) /logs
3546 ct_run -dir test -suite $(CT_SUITES ) -pa $(CT_BUILD_PATH ) -logdir $(CT_PATH ) /logs $(CT_OPTS )
You can’t perform that action at this time.
0 commit comments