Makefile 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. ERLFLAGS= -pa $(CURDIR)/.eunit -pa $(CURDIR)/ebin -pa $(CURDIR)/deps/*/ebin
  2. DEPS_PLT=$(CURDIR)/.deps_plt
  3. # =============================================================================
  4. # Verify that the programs we need to run are installed on this system
  5. # =============================================================================
  6. ERL = $(shell which erl)
  7. ifeq ($(ERL),)
  8. $(error "Erlang not available on this system")
  9. endif
  10. REBAR=$(shell which rebar)
  11. # If building on travis, use the rebar in the current directory
  12. ifeq ($(TRAVIS),true)
  13. REBAR=$(CURDIR)/rebar
  14. endif
  15. ifeq ($(REBAR),)
  16. REBAR=$(CURDIR)/rebar
  17. endif
  18. .PHONY: all compile test dialyzer clean distclean doc
  19. all: compile test dialyzer
  20. REBAR_URL=https://github.com/rebar/rebar/wiki/rebar
  21. $(REBAR):
  22. curl -Lo rebar $(REBAR_URL) || wget $(REBAR_URL)
  23. chmod a+x rebar
  24. get-rebar: $(REBAR)
  25. compile: $(REBAR)
  26. $(REBAR) compile
  27. eunit: compile clean-common-test-data
  28. $(REBAR) skip_deps=true eunit
  29. ct: compile clean-common-test-data
  30. mkdir -p $(CURDIR) logs
  31. ct_run -pa $(CURDIR)/ebin \
  32. -pa $(CURDIR)/deps/*/ebin \
  33. -logdir $(CURDIR)/logs \
  34. -dir $(CURDIR)/test/ \
  35. -cover cover.spec
  36. test: compile dialyzer eunit ct
  37. $(DEPS_PLT): compile
  38. @echo Building local erts plt at $(DEPS_PLT)
  39. @echo
  40. $(DIALYZER) --output_plt $(DEPS_PLT) --build_plt \
  41. --apps erts kernel stdlib -r deps
  42. dialyzer: compile $(DEPS_PLT)
  43. @dialyzer -Wunderspecs -r ebin
  44. doc:
  45. $(REBAR) doc skip_deps=true
  46. clean-common-test-data:
  47. # We have to do this because of the unique way we generate test
  48. # data. Without this rebar eunit gets very confused
  49. - rm -rf $(CURDIR)/test/*_SUITE_data
  50. clean: clean-common-test-data $(REBAR)
  51. - rm -rf $(CURDIR)/test/*.beam
  52. - rm -rf $(CURDIR)/logs
  53. - rm -rf $(CURDIR)/ebin
  54. $(REBAR) skip_deps=true clean
  55. distclean: clean
  56. - rm -rf $(DEPS_PLT)
  57. $(REBAR) delete-deps
  58. demo_shell: compile test
  59. @erl -pa .eunit ebin -config pooler-example -s pooler manual_start