Makefile 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. .PHONY: rel deps test plugins
  2. APP = emqttd
  3. BASE_DIR = $(shell pwd)
  4. REBAR = $(BASE_DIR)/rebar
  5. DIST = $(BASE_DIR)/rel/$(APP)
  6. all: submods compile
  7. submods:
  8. @git submodule update --init
  9. compile: deps
  10. @$(REBAR) compile
  11. deps:
  12. @$(REBAR) get-deps
  13. update-deps:
  14. @$(REBAR) update-deps
  15. xref:
  16. @$(REBAR) xref skip_deps=true
  17. clean:
  18. @$(REBAR) clean
  19. test:
  20. ERL_FLAGS="-config rel/files/emqttd.test.config" $(REBAR) -v skip_deps=true ct
  21. #$(REBAR) skip_deps=true eunit
  22. edoc:
  23. @$(REBAR) doc
  24. rel: compile
  25. @cd rel && $(REBAR) generate -f
  26. plugins:
  27. @for plugin in ./plugins/* ; do \
  28. if [ -d $${plugin} ]; then \
  29. mkdir -p $(DIST)/$${plugin}/ ; \
  30. cp -R $${plugin}/ebin $(DIST)/$${plugin}/ ; \
  31. [ -d "$${plugin}/priv" ] && cp -R $${plugin}/priv $(DIST)/$${plugin}/ ; \
  32. [ -d "$${plugin}/etc" ] && cp -R $${plugin}/etc $(DIST)/$${plugin}/ ; \
  33. echo "$${plugin} copied" ; \
  34. fi \
  35. done
  36. dist: rel plugins
  37. PLT = $(BASE_DIR)/.emqttd_dialyzer.plt
  38. APPS = erts kernel stdlib sasl crypto ssl os_mon syntax_tools \
  39. public_key mnesia inets compiler
  40. check_plt: compile
  41. dialyzer --check_plt --plt $(PLT) --apps $(APPS) \
  42. deps/*/ebin ./ebin plugins/*/ebin
  43. build_plt: compile
  44. dialyzer --build_plt --output_plt $(PLT) --apps $(APPS) \
  45. deps/*/ebin ./ebin plugins/*/ebin
  46. dialyzer: compile
  47. dialyzer -Wno_return --plt $(PLT) deps/*/ebin ./ebin plugins/*/ebin