Makefile 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. ERL=erl
  2. ERLC=erlc
  3. REBAR=./rebar $(REBAR_ARGS)
  4. all: compile
  5. compile: check-slex
  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. compile_test:
  11. -mkdir -p ebintest
  12. $(ERLC) -o tests/src -I include/erlydtl_preparser.hrl tests/src/erlydtl_extension_testparser.yrl
  13. $(ERL) -make
  14. test: compile compile_test
  15. $(ERL) -noshell -pa ebin -pa ebintest \
  16. -eval \
  17. "try \
  18. erlydtl_functional_tests:run_tests(), \
  19. erlydtl_dateformat_tests:run_tests(), \
  20. erlydtl_unittests:run_tests(), \
  21. sources_parser_unittests:run_tests(), \
  22. halt(0) \
  23. catch throw:failed -> halt(1) end"
  24. check: test dialyze
  25. DIALYZER_OPTS ?= -Werror_handling -Wrace_conditions -Wunmatched_returns
  26. dialyze:
  27. @dialyzer -nn $(DIALYZER_OPTS) ebin || [ $$? -eq 2 ];
  28. ## In case you are missing a plt file for dialyzer,
  29. ## you can run/adapt this command
  30. PLT_APPS ?=
  31. plt:
  32. @dialyzer -n -nn --build_plt --apps \
  33. erts kernel stdlib sasl compiler \
  34. crypto syntax_tools runtime_tools \
  35. tools webtool hipe inets eunit
  36. clean:
  37. @$(REBAR) clean
  38. rm -fv ebintest/*
  39. rm -fv erl_crash.dump
  40. rm -fv tests/output/*
  41. # rebuild any .slex files as well.. not included by default to avoid
  42. # the slex dependency, which is only needed in case the .slex file has
  43. # been modified locally.
  44. slex: REBAR_DEPS ?= get-deps update-deps
  45. slex: slex-compile
  46. slex-skip-deps: REBAR_DEPS:=
  47. slex-skip-deps: slex-compile
  48. slex-compile:
  49. @$(REBAR) -C rebar-slex.config $(REBAR_DEPS) compile