|
1 |
| -REBAR ?= ./rebar |
| 1 | +REBAR ?= ./rebar3 |
2 | 2 |
|
3 | 3 | docs:
|
4 | 4 | ${REBAR} doc skip_deps=true
|
5 | 5 |
|
6 | 6 | xref: compile
|
7 | 7 | ${REBAR} xref skip_deps=true
|
8 |
| - |
9 |
| -PLT ?= $(HOME)/.combo_dialyzer_plt |
10 |
| -LOCAL_PLT = .local_dialyzer_plt |
11 |
| -DIALYZER_FLAGS ?= -Wunmatched_returns -Werror_handling -Wrace_conditions -Wunderspecs |
12 |
| - |
13 |
| -${PLT}: compile |
14 |
| - @if [ -f $(PLT) ]; then \ |
15 |
| - dialyzer --check_plt --plt $(PLT) --apps $(DIALYZER_APPS) && \ |
16 |
| - dialyzer --add_to_plt --plt $(PLT) --output_plt $(PLT) --apps $(DIALYZER_APPS) ; test $$? -ne 1; \ |
17 |
| - else \ |
18 |
| - dialyzer --build_plt --output_plt $(PLT) --apps $(DIALYZER_APPS); test $$? -ne 1; \ |
19 |
| - fi |
20 |
| - |
21 |
| -${LOCAL_PLT}: compile |
22 |
| - @if [ -d deps ]; then \ |
23 |
| - if [ -f $(LOCAL_PLT) ]; then \ |
24 |
| - dialyzer --check_plt --plt $(LOCAL_PLT) deps/*/ebin && \ |
25 |
| - dialyzer --add_to_plt --plt $(LOCAL_PLT) --output_plt $(LOCAL_PLT) deps/*/ebin ; test $$? -ne 1; \ |
26 |
| - else \ |
27 |
| - dialyzer --build_plt --output_plt $(LOCAL_PLT) deps/*/ebin ; test $$? -ne 1; \ |
28 |
| - fi \ |
29 |
| - fi |
30 |
| - |
31 |
| -dialyzer: ${PLT} ${LOCAL_PLT} |
32 |
| - @echo "==> $(shell basename $(shell pwd)) (dialyzer)" |
33 |
| - @if [ -f $(LOCAL_PLT) ]; then \ |
34 |
| - PLTS="$(PLT) $(LOCAL_PLT)"; \ |
35 |
| - else \ |
36 |
| - PLTS=$(PLT); \ |
37 |
| - fi; \ |
38 |
| - if [ -f dialyzer.ignore-warnings ]; then \ |
39 |
| - if [ $$(grep -cvE '[^[:space:]]' dialyzer.ignore-warnings) -ne 0 ]; then \ |
40 |
| - echo "ERROR: dialyzer.ignore-warnings contains a blank/empty line, this will match all messages!"; \ |
41 |
| - exit 1; \ |
42 |
| - fi; \ |
43 |
| - dialyzer $(DIALYZER_FLAGS) --plts $${PLTS} -c ebin > dialyzer_warnings ; \ |
44 |
| - egrep -v "^[[:space:]]*(done|Checking|Proceeding|Compiling)" dialyzer_warnings | grep -F -f dialyzer.ignore-warnings -v > dialyzer_unhandled_warnings ; \ |
45 |
| - cat dialyzer_unhandled_warnings ; \ |
46 |
| - [ $$(cat dialyzer_unhandled_warnings | wc -l) -eq 0 ] ; \ |
47 |
| - else \ |
48 |
| - dialyzer $(DIALYZER_FLAGS) --plts $${PLTS} -c ebin; \ |
49 |
| - fi |
50 |
| - |
51 |
| -cleanplt: |
52 |
| - @echo |
53 |
| - @echo "Are you sure? It takes several minutes to re-build." |
54 |
| - @echo Deleting $(PLT) and $(LOCAL_PLT) in 5 seconds. |
55 |
| - @echo |
56 |
| - sleep 5 |
57 |
| - rm $(PLT) |
58 |
| - rm $(LOCAL_PLT) |
59 |
| - |
0 commit comments