-
Notifications
You must be signed in to change notification settings - Fork 8
/
Makefile
71 lines (52 loc) · 1.15 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
#
# credit https://github.com/chef/mini_s3
#
#
# Use rebar3 from either:
# - ./rebar3
# - rebar3 on the PATH (found via which)
# - Downloaded from $REBAR3_URL
#
.PHONY: all clean tests disclean tests rel travis update xref \
shell install dialyzer rebar3
ifeq ($(ERL),)
$(error "Erlang not available on this system")
endif
# If building on travis, use the rebar in the current directory
ifeq ($(TRAVIS),true)
REBAR = $(CURDIR)/rebar
endif
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
REBAR3_URL=https://s3.amazonaws.com/rebar3/rebar3
all: $(REBAR3)
@$(REBAR3) do clean, compile, eunit
rel: all
@$(REBAR3) release
tests:
@$(REBAR3) eunit ct
shell:
@$(REBAR3) as shell shell
dialyzer:
@$(REBAR3) dialyzer
xref:
@$(REBAR3) xref
update:
@$(REBAR3) update
install: $(REBAR3) distclean update
distclean: clean
@rm -rf _build
clean:
@$(REBAR3) clean skip_deps=true
$(REBAR3):
curl -Lo rebar3 $(REBAR3_URL) || wget $(REBAR3_URL)
chmod +x ./rebar3
travis: all
@echo "Travis'd!"