Makefile 1.7 KB

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