-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
executable file
·88 lines (70 loc) · 2.13 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
76
77
78
79
80
81
82
83
84
85
86
87
88
.PHONY: all clean test eunit deps doc dialyzer
PROJECT=$(basename $(CURDIR))
REBAR=@rebar
DIALYZER=@dialyzer
DIALYZER_OPTS =
#DIALYZER_OPTS = -Werror_handling -Wrace_conditions -Wunmatched_returns # -Wunderspecs
# Dependencies that should be included in a cached dialyzer PLT file.
DIALYZER_DEPS = deps/*/ebin
#DIALYZER_DEPS = deps/cowboy/ebin \
# deps/jiffy/ebin \
# deps/elib/ebin \
# deps/erl8583/ebin
DEPS_PLT = $(PROJECT).plt
ERLANG_DIALYZER_APPS = asn1 \
compiler \
crypto \
edoc \
erts \
eunit \
gs \
hipe \
inets \
kernel \
mnesia \
observer \
public_key \
runtime_tools \
ssl \
stdlib \
syntax_tools \
tools \
webtool \
xmerl
EUNIT_FLAGS=-sasl errlog_type error
all: deps compile
deps:
$(REBAR) get-deps
compile:
ifeq ($(NODEPS),true)
$(REBAR) compile skip_deps=true
else
$(REBAR) compile
endif
clean:
$(REBAR) clean
test: all
rm -rf .eunit
$(REBAR) eunit skip_deps=true
eunit:
ifeq ($(SUITES),) # comma separated module names
ERL_FLAGS="$(EUNIT_FLAGS)" $(REBAR) eunit skip_deps=true
else
ERL_FLAGS="$(EUNIT_FLAGS)" $(REBAR) eunit skip_deps=true suites=$(SUITES)
endif
# Only include local PLT if we have deps that we are going to analyze
ifeq ($(strip $(DIALYZER_DEPS)),)
dialyzer: ~/.dialyzer_plt
$(DIALYZER) $(DIALYZER_OPTS) -r ebin test
else
dialyzer: ~/.dialyzer_plt $(DEPS_PLT)
$(DIALYZER) $(DIALYZER_OPTS) --plts ~/.dialyzer_plt $(DEPS_PLT) -r ebin test
$(DEPS_PLT):
$(DIALYZER) --build_plt $(DIALYZER_DEPS) --output_plt $(DEPS_PLT)
endif
~/.dialyzer_plt:
@echo "ERROR: Missing ~/.dialyzer_plt. Please wait while a new PLT is compiled."
$(DIALYZER) --build_plt --apps $(ERLANG_DIALYZER_APPS)
@echo "now try your build again"
doc:
$(REBAR) doc skip_deps=true