Makefile 873 B

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