2012-06-19 14:00:06 +00:00
|
|
|
REBAR= rebar
|
|
|
|
DIALYZER= dialyzer
|
|
|
|
|
2014-04-02 21:51:23 +00:00
|
|
|
DEPS = $(CURDIR)/deps
|
|
|
|
|
|
|
|
DIALYZER_OPTS = # -Wunderspecs
|
|
|
|
|
|
|
|
# List dependencies that should be included in a cached dialyzer PLT file.
|
|
|
|
DIALYZER_DEPS = deps/lz4/ebin \
|
|
|
|
deps/snappy/ebin \
|
|
|
|
deps/plain_fsm/ebin
|
|
|
|
|
|
|
|
DEPS_PLT = hanoi.plt
|
|
|
|
|
|
|
|
ERLANG_DIALYZER_APPS = asn1 \
|
|
|
|
compiler \
|
|
|
|
crypto \
|
|
|
|
edoc \
|
|
|
|
edoc \
|
|
|
|
erts \
|
|
|
|
eunit \
|
|
|
|
eunit \
|
|
|
|
gs \
|
|
|
|
hipe \
|
|
|
|
inets \
|
|
|
|
kernel \
|
|
|
|
mnesia \
|
|
|
|
mnesia \
|
|
|
|
observer \
|
|
|
|
public_key \
|
|
|
|
runtime_tools \
|
|
|
|
runtime_tools \
|
|
|
|
ssl \
|
|
|
|
stdlib \
|
|
|
|
syntax_tools \
|
|
|
|
syntax_tools \
|
|
|
|
tools \
|
|
|
|
webtool \
|
|
|
|
xmerl
|
|
|
|
|
2012-01-06 20:22:23 +00:00
|
|
|
|
|
|
|
.PHONY: plt analyze all deps compile get-deps clean
|
|
|
|
|
|
|
|
all: compile
|
|
|
|
|
2012-04-15 14:35:39 +00:00
|
|
|
deps: get-deps
|
|
|
|
|
2012-01-06 20:22:23 +00:00
|
|
|
get-deps:
|
|
|
|
@$(REBAR) get-deps
|
|
|
|
|
|
|
|
compile:
|
|
|
|
@$(REBAR) compile
|
|
|
|
|
|
|
|
clean:
|
|
|
|
@$(REBAR) clean
|
|
|
|
|
2012-04-15 14:35:39 +00:00
|
|
|
test: eunit
|
|
|
|
|
2012-01-06 21:55:07 +00:00
|
|
|
eunit: compile clean-test-btrees
|
|
|
|
@$(REBAR) eunit skip_deps=true
|
|
|
|
|
2012-01-21 14:13:22 +00:00
|
|
|
eunit_console:
|
|
|
|
erl -pa .eunit deps/*/ebin
|
|
|
|
|
2012-01-06 21:55:07 +00:00
|
|
|
clean-test-btrees:
|
2012-01-06 23:58:57 +00:00
|
|
|
rm -fr .eunit/Btree_* .eunit/simple
|
2012-01-06 21:55:07 +00:00
|
|
|
|
2012-01-06 20:22:23 +00:00
|
|
|
plt: compile
|
2012-04-21 19:20:39 +00:00
|
|
|
$(DIALYZER) --build_plt --output_plt .hanoi.plt \
|
2012-09-26 13:11:55 +00:00
|
|
|
-pa deps/snappy/ebin \
|
2012-01-06 20:22:23 +00:00
|
|
|
-pa deps/plain_fsm/ebin \
|
|
|
|
deps/plain_fsm/ebin \
|
|
|
|
--apps kernel stdlib
|
|
|
|
|
|
|
|
analyze: compile
|
2012-04-21 19:20:39 +00:00
|
|
|
$(DIALYZER) --plt .hanoi.plt \
|
2012-09-26 13:11:55 +00:00
|
|
|
-pa deps/snappy/ebin \
|
2012-01-06 20:22:23 +00:00
|
|
|
-pa deps/plain_fsm/ebin \
|
|
|
|
ebin
|
|
|
|
|
2012-09-26 13:11:55 +00:00
|
|
|
analyze-nospec: compile
|
|
|
|
$(DIALYZER) --plt .hanoi.plt \
|
|
|
|
-pa deps/plain_fsm/ebin \
|
|
|
|
--no_spec \
|
|
|
|
ebin
|
|
|
|
|
2014-04-02 21:51:23 +00:00
|
|
|
# Only include local PLT if we have deps that we are going to analyze
|
|
|
|
ifeq ($(strip $(DIALYZER_DEPS)),)
|
|
|
|
dialyzer: ~/.dialyzer_plt compile
|
|
|
|
@dialyzer $(DIALYZER_OPTS) -r ebin
|
|
|
|
else
|
|
|
|
dialyzer: ~/.dialyzer_plt $(DEPS_PLT) compile
|
|
|
|
@dialyzer $(DIALYZER_OPTS) --plts ~/.dialyzer_plt $(DEPS_PLT) -r ebin
|
|
|
|
|
|
|
|
$(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"
|
|
|
|
|
2012-04-15 14:35:39 +00:00
|
|
|
repl:
|
2012-06-14 17:03:55 +00:00
|
|
|
erl -pz deps/*/ebin -pa ebin
|