Makefile 849 B

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