Makefile 955 B

12345678910111213141516171819202122232425262728293031323334353637383940
  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) as dev compile
  7. run: $(REBAR)
  8. @$(REBAR) as test shell --apps pooler --config config/demo.config
  9. test: $(REBAR)
  10. $(REBAR) eunit --verbose --cover
  11. $(REBAR) cover --verbose --min_coverage $(MINIMAL_COVERAGE)
  12. xref: $(REBAR)
  13. $(REBAR) xref
  14. doc: $(REBAR)
  15. $(REBAR) as dev edoc
  16. clean: $(REBAR)
  17. $(REBAR) as dev clean
  18. $(REBAR) as test clean
  19. @rm -rf ./erl_crash.dump
  20. dialyzer: $(REBAR)
  21. $(REBAR) as dev dialyzer
  22. # Get rebar3 if it doesn't exist. If rebar3 was found on PATH, the
  23. # $(REBAR) dep will be satisfied since the file will exist.
  24. REBAR_URL = https://s3.amazonaws.com/rebar3/rebar3
  25. ./rebar3:
  26. @echo "Fetching rebar3 from $(REBAR_URL)"
  27. @erl -noinput -noshell -s inets -s ssl -eval '{ok, _} = httpc:request(get, {"${REBAR_URL}", []}, [], [{stream, "${REBAR}"}])' -s init stop
  28. chmod +x ${REBAR}