Browse Source

Refactor into tools.mk

pull/187/head
Andrew Thompson 11 years ago
parent
commit
58bf04318e
3 changed files with 42 additions and 41 deletions
  1. +1
    -1
      .gitignore
  2. +2
    -40
      Makefile
  3. +39
    -0
      tools.mk

+ 1
- 1
.gitignore View File

@ -7,4 +7,4 @@ erl_crash.dump
.project .project
log log
deps deps
.lager_combo_dialyzer_plt
.local_dialyzer_plt

+ 2
- 40
Makefile View File

@ -15,44 +15,6 @@ clean:
distclean: clean distclean: clean
./rebar delete-deps ./rebar delete-deps
test:
./rebar compile eunit
##
## Doc targets
##
docs:
./rebar doc
APPS = kernel stdlib erts sasl eunit syntax_tools compiler crypto
PLT ?= $(HOME)/.riak_combo_dialyzer_plt
LOCAL_PLT = .lager_combo_dialyzer_plt
${PLT}: compile
ifneq (,$(wildcard $(PLT)))
dialyzer --check_plt --plt $(PLT) --apps $(APPS) && \
dialyzer --add_to_plt --plt $(PLT) --output_plt $(PLT) --apps $(APPS) ; test $$? -ne 1
else
dialyzer --build_plt --output_plt $(PLT) --apps $(APPS); test $$? -ne 1
endif
${LOCAL_PLT}: compile
ifneq (,$(wildcard $(LOCAL_PLT)))
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
endif
dialyzer: ${PLT} ${LOCAL_PLT}
dialyzer -Wunmatched_returns --plts $(PLT) $(LOCAL_PLT) -c ebin
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)
DIALYZER_APPS = kernel stdlib erts sasl eunit syntax_tools compiler crypto
include tools.mk

+ 39
- 0
tools.mk View File

@ -0,0 +1,39 @@
test: compile
./rebar eunit skip_deps=true
docs:
./rebar doc skip_deps=true
PLT ?= $(HOME)/.riak_combo_dialyzer_plt
LOCAL_PLT = .local_dialyzer_plt
DIALYZER_FLAGS ?= -Wunmatched_returns
${PLT}: compile
ifneq (,$(wildcard $(PLT)))
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
endif
${LOCAL_PLT}: compile
ifneq (,$(wildcard $(LOCAL_PLT)))
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
endif
dialyzer: ${PLT} ${LOCAL_PLT}
@echo "==> $(shell basename $(shell pwd)) (dialyzer)"
dialyzer $(DIALYZER_FLAGS) --plts $(PLT) $(LOCAL_PLT) -c ebin
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)

Loading…
Cancel
Save