dialyzer.mk 941 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. distclean:: distclean-plt
  13. help::
  14. @printf "%s\n" "" \
  15. "Dialyzer targets:" \
  16. " plt Build a PLT file for this project" \
  17. " dialyze Analyze the project using Dialyzer"
  18. # Plugin-specific targets.
  19. $(DIALYZER_PLT): deps app
  20. @dialyzer --build_plt --apps erts kernel stdlib $(PLT_APPS) $(ALL_DEPS_DIRS)
  21. plt: $(DIALYZER_PLT)
  22. distclean-plt:
  23. $(gen_verbose) rm -f $(DIALYZER_PLT)
  24. ifneq ($(wildcard $(DIALYZER_PLT)),)
  25. dialyze:
  26. else
  27. dialyze: $(DIALYZER_PLT)
  28. endif
  29. @dialyzer --no_native $(DIALYZER_DIRS) $(DIALYZER_OPTS)