Makefile 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. .PHONY: all compile run test doc clean
  2. REBAR=$(shell which rebar3 || echo ./rebar3)
  3. MINIMAL_COVERAGE=80
  4. all: compile
  5. compile: $(REBAR)
  6. $(REBAR) compile
  7. run: $(REBAR)
  8. @$(REBAR) as test shell --apps pooler --config config/demo.config
  9. eunit: $(REBAR)
  10. $(REBAR) eunit --verbose --cover
  11. proper: $(REBAR)
  12. $(REBAR) proper --cover
  13. cover: $(REBAR)
  14. $(REBAR) cover --verbose --min_coverage $(MINIMAL_COVERAGE)
  15. test: eunit proper cover
  16. xref: $(REBAR)
  17. $(REBAR) xref
  18. format: $(REBAR)
  19. $(REBAR) fmt
  20. format_check: $(REBAR)
  21. $(REBAR) fmt --check
  22. doc: $(REBAR)
  23. $(REBAR) edoc
  24. clean: $(REBAR)
  25. $(REBAR) clean
  26. $(REBAR) as test clean
  27. @rm -rf ./erl_crash.dump
  28. dialyzer: $(REBAR)
  29. $(REBAR) dialyzer
  30. # Get rebar3 if it doesn't exist. If rebar3 was found on PATH, the
  31. # $(REBAR) dep will be satisfied since the file will exist.
  32. REBAR_URL = https://s3.amazonaws.com/rebar3/rebar3
  33. ./rebar3:
  34. @echo "Fetching rebar3 from $(REBAR_URL)"
  35. @erl -noinput -noshell -s inets -s ssl -eval '{ok, _} = httpc:request(get, {"${REBAR_URL}", []}, [], [{stream, "${REBAR}"}])' -s init stop
  36. chmod +x ${REBAR}