aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/dialyzer.mk
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2014-05-28 22:07:54 +0200
committerLoïc Hoguin <[email protected]>2014-05-28 22:17:51 +0200
commit58b99e7f457bc056e91d2d1721cbb65fcd517afe (patch)
tree16f20657dcb4f1713ff3bfc02de875b85e7875c4 /plugins/dialyzer.mk
parentb47d3f4c3e097aa28a08f72931d2ce8c50039681 (diff)
downloaderlang.mk-58b99e7f457bc056e91d2d1721cbb65fcd517afe.tar.gz
erlang.mk-58b99e7f457bc056e91d2d1721cbb65fcd517afe.tar.bz2
erlang.mk-58b99e7f457bc056e91d2d1721cbb65fcd517afe.zip
Cut erlang.mk into many small components
* The build.config says what gets into the generated erlang.mk. * The default erlang.mk in the repository hasn't changed yet. * Clean targets were separated into "clean" and "distclean". * The "help" target was added to display some help message. I probably broke a couple things...
Diffstat (limited to 'plugins/dialyzer.mk')
-rw-r--r--plugins/dialyzer.mk34
1 files changed, 34 insertions, 0 deletions
diff --git a/plugins/dialyzer.mk b/plugins/dialyzer.mk
new file mode 100644
index 0000000..8754919
--- /dev/null
+++ b/plugins/dialyzer.mk
@@ -0,0 +1,34 @@
+# Copyright (c) 2013-2014, Loïc Hoguin <[email protected]>
+# This file is part of erlang.mk and subject to the terms of the ISC License.
+
+.PHONY: plt distclean-plt dialyze
+
+# Configuration.
+
+DIALYZER_PLT ?= $(CURDIR)/.$(PROJECT).plt
+export DIALYZER_PLT
+
+PLT_APPS ?=
+DIALYZER_OPTS ?= -Werror_handling -Wrace_conditions \
+ -Wunmatched_returns # -Wunderspecs
+
+# Core targets.
+
+distclean:: distclean-plt
+
+help::
+ @printf "%s\n" "" \
+ "Dialyzer targets:" \
+ " plt Build a PLT file for this project" \
+ " dialyze Analyze the project using Dialyzer"
+
+# Plugin-specific targets.
+
+plt: deps app
+ @dialyzer --build_plt --apps erts kernel stdlib $(PLT_APPS) $(ALL_DEPS_DIRS)
+
+distclean-plt:
+ $(gen_verbose) rm -f $(DIALYZER_PLT)
+
+dialyze:
+ @dialyzer --src src --no_native $(DIALYZER_OPTS)