dialyzer.mk 958 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. # Copyright (c) 2013-2015, Loïc Hoguin <essen@ninenines.eu>
  2. # This file is part of erlang.mk and subject to the terms of the ISC License.
  3. .PHONY: plt distclean-plt dialyze
  4. # Configuration.
  5. DIALYZER_PLT ?= $(CURDIR)/.$(PROJECT).plt
  6. export DIALYZER_PLT
  7. PLT_APPS ?=
  8. DIALYZER_DIRS ?= --src -r src
  9. DIALYZER_OPTS ?= -Werror_handling -Wrace_conditions \
  10. -Wunmatched_returns # -Wunderspecs
  11. # Core targets.
  12. check:: dialyze
  13. distclean:: distclean-plt
  14. help::
  15. @printf "%s\n" "" \
  16. "Dialyzer targets:" \
  17. " plt Build a PLT file for this project" \
  18. " dialyze Analyze the project using Dialyzer"
  19. # Plugin-specific targets.
  20. $(DIALYZER_PLT): deps app
  21. @dialyzer --build_plt --apps erts kernel stdlib $(PLT_APPS) $(ALL_DEPS_DIRS)
  22. plt: $(DIALYZER_PLT)
  23. distclean-plt:
  24. $(gen_verbose) rm -f $(DIALYZER_PLT)
  25. ifneq ($(wildcard $(DIALYZER_PLT)),)
  26. dialyze:
  27. else
  28. dialyze: $(DIALYZER_PLT)
  29. endif
  30. @dialyzer --no_native $(DIALYZER_DIRS) $(DIALYZER_OPTS)