Makefile 1.7 KB

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