dialyzer.mk 907 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. # Copyright (c) 2013-2014, 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_OPTS ?= -Werror_handling -Wrace_conditions \
  9. -Wunmatched_returns # -Wunderspecs
  10. # Core targets.
  11. distclean:: distclean-plt
  12. help::
  13. @printf "%s\n" "" \
  14. "Dialyzer targets:" \
  15. " plt Build a PLT file for this project" \
  16. " dialyze Analyze the project using Dialyzer"
  17. # Plugin-specific targets.
  18. $(DIALYZER_PLT): deps app
  19. @dialyzer --build_plt --apps erts kernel stdlib $(PLT_APPS) $(ALL_DEPS_DIRS)
  20. plt: $(DIALYZER_PLT)
  21. distclean-plt:
  22. $(gen_verbose) rm -f $(DIALYZER_PLT)
  23. ifneq ($(wildcard $(DIALYZER_PLT)),)
  24. dialyze:
  25. else
  26. dialyze: $(DIALYZER_PLT)
  27. endif
  28. @dialyzer --no_native --src -r src $(DIALYZER_OPTS)