Makefile 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. .PHONY: all compile run test doc clean
  2. .PHONY: build_plt add_to_plt dialyzer
  3. REBAR=./rebar3
  4. DIALYZER_APPS = asn1 compiler crypto erts inets kernel public_key sasl ssl stdlib syntax_tools tools
  5. all: $(REBAR) compile
  6. compile:
  7. $(REBAR) as dev compile
  8. run:
  9. erl -pa _build/dev/lib/*/ebin -boot start_sasl -config config/demo.config -run pooler
  10. test:
  11. $(REBAR) eunit skip_deps=true verbose=3
  12. $(REBAR) ct skip_deps=true verbose=3
  13. doc:
  14. $(REBAR) as dev edoc
  15. clean:
  16. $(REBAR) clean
  17. rm -rf ./erl_crash.dump
  18. build_plt: clean compile
  19. ifneq ("$(wildcard erlang.plt)","")
  20. @echo "Erlang plt file already exists"
  21. else
  22. dialyzer --build_plt --output_plt erlang.plt --apps $(DIALYZER_APPS)
  23. endif
  24. ifneq ("$(wildcard pooler.plt)","")
  25. @echo "redis_pool plt file already exists"
  26. else
  27. dialyzer --build_plt --output_plt pooler.plt _build/default/lib/*/ebin/
  28. endif
  29. add_to_plt: build_plt
  30. dialyzer --add_to_plt --plt erlang.plt --output_plt erlang.plt.new --apps $(DIALYZER_APPS)
  31. dialyzer --add_to_plt --plt pooler.plt --output_plt pooler.plt.new _build/default/lib/*/ebin/
  32. mv erlang.plt.new erlang.plt
  33. mv pooler.plt.new pooler.plt
  34. dialyzer:
  35. dialyzer --src src -r src --plts erlang.plt pooler.plt -Wno_return -Werror_handling -Wrace_conditions -Wunderspecs | fgrep -v -f ./dialyzer.ignore-warnings