Makefile 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. ERL=erl
  2. ERLC=erlc
  3. REBAR=./rebar $(REBAR_ARGS)
  4. all: compile
  5. compile: check-slex get-deps
  6. @$(REBAR) compile
  7. check-slex: src/erlydtl_scanner.erl
  8. src/erlydtl_scanner.erl: src/erlydtl_scanner.slex
  9. @echo Notice: $@ is outdated by $<, consider running "'make slex'".
  10. get-deps:
  11. @$(REBAR) get-deps
  12. update-deps:
  13. @$(REBAR) update-deps
  14. .PHONY: tests
  15. tests:
  16. @$(REBAR) eunit
  17. check: tests dialyze
  18. DIALYZER_OPTS ?= -Werror_handling -Wrace_conditions -Wunmatched_returns
  19. dialyze:
  20. @dialyzer -nn $(DIALYZER_OPTS) ebin || [ $$? -eq 2 ];
  21. ## In case you are missing a plt file for dialyzer,
  22. ## you can run/adapt this command
  23. PLT_APPS ?=
  24. plt:
  25. @dialyzer -n -nn --build_plt --apps \
  26. erts kernel stdlib sasl compiler \
  27. crypto syntax_tools runtime_tools \
  28. tools webtool hipe inets eunit
  29. clean:
  30. @echo "Clean merl..." ; $(MAKE) -C deps/merl clean
  31. @$(REBAR) clean
  32. rm -fv ebintest/*
  33. rm -fv erl_crash.dump
  34. rm -fv tests/output/*
  35. # rebuild any .slex files as well.. not included by default to avoid
  36. # the slex dependency, which is only needed in case the .slex file has
  37. # been modified locally.
  38. slex: REBAR_DEPS ?= get-deps update-deps
  39. slex: slex-compile
  40. slex-skip-deps: REBAR_DEPS:=
  41. slex-skip-deps: slex-compile
  42. slex-compile:
  43. @$(REBAR) -C rebar-slex.config $(REBAR_DEPS) compile