This repository has been archived by the owner on Apr 4, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
04bf4d3
commit 1731456
Showing
2 changed files
with
4 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,3 +21,6 @@ rel: | |
|
||
stage: | ||
$(REBAR) release -d | ||
|
||
dialyzer: | ||
$(REBAR) dialyzer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,7 @@ | ||
REBAR ?= ./rebar | ||
REBAR ?= ./rebar3 | ||
|
||
docs: | ||
${REBAR} doc skip_deps=true | ||
|
||
xref: compile | ||
${REBAR} xref skip_deps=true | ||
|
||
PLT ?= $(HOME)/.combo_dialyzer_plt | ||
LOCAL_PLT = .local_dialyzer_plt | ||
DIALYZER_FLAGS ?= -Wunmatched_returns -Werror_handling -Wrace_conditions -Wunderspecs | ||
|
||
${PLT}: compile | ||
@if [ -f $(PLT) ]; then \ | ||
dialyzer --check_plt --plt $(PLT) --apps $(DIALYZER_APPS) && \ | ||
dialyzer --add_to_plt --plt $(PLT) --output_plt $(PLT) --apps $(DIALYZER_APPS) ; test $$? -ne 1; \ | ||
else \ | ||
dialyzer --build_plt --output_plt $(PLT) --apps $(DIALYZER_APPS); test $$? -ne 1; \ | ||
fi | ||
|
||
${LOCAL_PLT}: compile | ||
@if [ -d deps ]; then \ | ||
if [ -f $(LOCAL_PLT) ]; then \ | ||
dialyzer --check_plt --plt $(LOCAL_PLT) deps/*/ebin && \ | ||
dialyzer --add_to_plt --plt $(LOCAL_PLT) --output_plt $(LOCAL_PLT) deps/*/ebin ; test $$? -ne 1; \ | ||
else \ | ||
dialyzer --build_plt --output_plt $(LOCAL_PLT) deps/*/ebin ; test $$? -ne 1; \ | ||
fi \ | ||
fi | ||
|
||
dialyzer: ${PLT} ${LOCAL_PLT} | ||
@echo "==> $(shell basename $(shell pwd)) (dialyzer)" | ||
@if [ -f $(LOCAL_PLT) ]; then \ | ||
PLTS="$(PLT) $(LOCAL_PLT)"; \ | ||
else \ | ||
PLTS=$(PLT); \ | ||
fi; \ | ||
if [ -f dialyzer.ignore-warnings ]; then \ | ||
if [ $$(grep -cvE '[^[:space:]]' dialyzer.ignore-warnings) -ne 0 ]; then \ | ||
echo "ERROR: dialyzer.ignore-warnings contains a blank/empty line, this will match all messages!"; \ | ||
exit 1; \ | ||
fi; \ | ||
dialyzer $(DIALYZER_FLAGS) --plts $${PLTS} -c ebin > dialyzer_warnings ; \ | ||
egrep -v "^[[:space:]]*(done|Checking|Proceeding|Compiling)" dialyzer_warnings | grep -F -f dialyzer.ignore-warnings -v > dialyzer_unhandled_warnings ; \ | ||
cat dialyzer_unhandled_warnings ; \ | ||
[ $$(cat dialyzer_unhandled_warnings | wc -l) -eq 0 ] ; \ | ||
else \ | ||
dialyzer $(DIALYZER_FLAGS) --plts $${PLTS} -c ebin; \ | ||
fi | ||
|
||
cleanplt: | ||
@echo | ||
@echo "Are you sure? It takes several minutes to re-build." | ||
@echo Deleting $(PLT) and $(LOCAL_PLT) in 5 seconds. | ||
@echo | ||
sleep 5 | ||
rm $(PLT) | ||
rm $(LOCAL_PLT) | ||
|