-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
63 lines (44 loc) · 918 Bytes
/
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
#
# Thanks to: https://github.com/chef/mini_s3
#
#
# Use rebar3 from either:
# - ./rebar3
# - rebar3 on the PATH (found via which)
# - Downloaded from $REBAR3_URL
#
.PHONY: all compile test dialyzer dialyze clean distclean shell docs edoc xref cover
REBAR3_URL=https://s3.amazonaws.com/rebar3/rebar3
ifeq ($(wildcard rebar3),rebar3)
REBAR3 = $(CURDIR)/rebar3
endif
# Fallback to rebar on PATH
REBAR3 ?= $(shell which rebar3)
# And finally, prep to download rebar if all else fails
ifeq ($(REBAR3),)
REBAR3 = rebar3
endif
all: compile
compile: $(REBAR3)
@$(REBAR3) compile
test:
@$(REBAR3) eunit
dialyzer:
@$(REBAR3) dialyzer
dialyze: dialyzer
clean:
@$(REBAR3) clean
distclean:
@rm -rf _build
shell:
@$(REBAR3) shell
docs:
@$(REBAR3) edoc
edoc: docs
xref:
@$(REBAR3) xref
cover:
@$(REBAR3) do eunit, cover
$(REBAR3):
curl -Lo rebar3 $(REBAR3_URL) || wget $(REBAR3_URL)
chmod a+x rebar3