Makefile 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. .PHONY: plugins tests
  2. PROJECT = emqx
  3. PROJECT_DESCRIPTION = EMQ X Broker
  4. PROJECT_VERSION = 3.0
  5. DEPS = jsx gproc gen_rpc lager ekka esockd cowboy clique lager_syslog
  6. dep_jsx = git https://github.com/talentdeficit/jsx 2.9.0
  7. dep_gproc = git https://github.com/uwiger/gproc 0.8.0
  8. dep_gen_rpc = git https://github.com/emqx/gen_rpc 2.2.0
  9. dep_lager = git https://github.com/erlang-lager/lager 3.6.4
  10. dep_esockd = git https://github.com/emqx/esockd v5.4
  11. dep_ekka = git https://github.com/emqx/ekka v0.4.1
  12. dep_cowboy = git https://github.com/ninenines/cowboy 2.4.0
  13. dep_clique = git https://github.com/emqx/clique
  14. dep_lager_syslog = git https://github.com/basho/lager_syslog 3.0.1
  15. NO_AUTOPATCH = cuttlefish
  16. ERLC_OPTS += +debug_info
  17. ERLC_OPTS += +'{parse_transform, lager_transform}'
  18. BUILD_DEPS = cuttlefish
  19. dep_cuttlefish = git https://github.com/emqx/cuttlefish emqx30
  20. #TEST_DEPS = emqx_ct_helplers
  21. #dep_emqx_ct_helplers = git git@github.com:emqx/emqx-ct-helpers
  22. TEST_ERLC_OPTS += +debug_info
  23. TEST_ERLC_OPTS += +'{parse_transform, lager_transform}'
  24. EUNIT_OPTS = verbose
  25. # CT_SUITES = emqx_mqueue
  26. ## emqx_trie emqx_router emqx_frame emqx_mqtt_compat
  27. CT_SUITES = emqx emqx_banned emqx_connection emqx_session emqx_access emqx_broker emqx_cm emqx_frame emqx_guid emqx_inflight \
  28. emqx_json emqx_keepalive emqx_lib emqx_metrics emqx_misc emqx_mod emqx_mqtt_caps \
  29. emqx_mqtt_compat emqx_mqtt_props emqx_mqueue emqx_net emqx_pqueue emqx_router emqx_sm \
  30. emqx_stats emqx_tables emqx_time emqx_topic emqx_trie emqx_vm emqx_zone \
  31. emqx_mountpoint emqx_listeners emqx_protocol
  32. CT_OPTS = -cover test/ct.cover.spec -erl_args -name emqxct@127.0.0.1
  33. COVER = true
  34. PLT_APPS = sasl asn1 ssl syntax_tools runtime_tools crypto xmerl os_mon inets public_key ssl lager compiler mnesia
  35. DIALYZER_DIRS := ebin/
  36. DIALYZER_OPTS := --verbose --statistics -Werror_handling -Wrace_conditions #-Wunmatched_returns
  37. include erlang.mk
  38. clean:: gen-clean
  39. .PHONY: gen-clean
  40. gen-clean:
  41. @rm -rf bbmustache
  42. @rm -f etc/gen.emqx.conf
  43. bbmustache:
  44. $(verbose) git clone https://github.com/soranoba/bbmustache.git && pushd bbmustache && ./rebar3 compile && popd
  45. # This hack is to generate a conf file for testing
  46. # relx overlay is used for release
  47. etc/gen.emqx.conf: bbmustache etc/emqx.conf
  48. $(verbose) erl -noshell -pa bbmustache/_build/default/lib/bbmustache/ebin -eval \
  49. "{ok, Temp} = file:read_file('etc/emqx.conf'), \
  50. {ok, Vars0} = file:consult('vars'), \
  51. Vars = [{atom_to_list(N), list_to_binary(V)} || {N, V} <- Vars0], \
  52. Targ = bbmustache:render(Temp, Vars), \
  53. ok = file:write_file('etc/gen.emqx.conf', Targ), \
  54. halt(0)."
  55. app.config: etc/gen.emqx.conf
  56. $(verbose) ./deps/cuttlefish/cuttlefish -l info -e etc/ -c etc/gen.emqx.conf -i priv/emqx.schema -d data/
  57. ct: app.config