You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by be...@apache.org on 2014/02/13 17:43:25 UTC

[23/50] lager commit: updated refs/heads/import-master to da4419e

Refactor into tools.mk


Project: http://git-wip-us.apache.org/repos/asf/couchdb-lager/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-lager/commit/58bf0431
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-lager/tree/58bf0431
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-lager/diff/58bf0431

Branch: refs/heads/import-master
Commit: 58bf04318e57ff404ca7b4b7d86e297778c3f676
Parents: 56a217c
Author: Andrew Thompson <an...@hijacked.us>
Authored: Tue Jan 14 15:30:40 2014 -0500
Committer: Andrew Thompson <an...@hijacked.us>
Committed: Tue Jan 14 15:30:40 2014 -0500

----------------------------------------------------------------------
 .gitignore |  2 +-
 Makefile   | 42 ++----------------------------------------
 tools.mk   | 39 +++++++++++++++++++++++++++++++++++++++
 3 files changed, 42 insertions(+), 41 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-lager/blob/58bf0431/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
index 02adf69..d053947 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,4 +7,4 @@ erl_crash.dump
 .project
 log
 deps
-.lager_combo_dialyzer_plt
+.local_dialyzer_plt

http://git-wip-us.apache.org/repos/asf/couchdb-lager/blob/58bf0431/Makefile
----------------------------------------------------------------------
diff --git a/Makefile b/Makefile
index 594e97f..4c61dd6 100644
--- a/Makefile
+++ b/Makefile
@@ -15,44 +15,6 @@ clean:
 distclean: clean
 	./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

http://git-wip-us.apache.org/repos/asf/couchdb-lager/blob/58bf0431/tools.mk
----------------------------------------------------------------------
diff --git a/tools.mk b/tools.mk
new file mode 100644
index 0000000..7e73423
--- /dev/null
+++ b/tools.mk
@@ -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)
+