Makefile 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. # See LICENSE for licensing information.
  2. PROJECT = cowboy
  3. PROJECT_DESCRIPTION = Small, fast, modern HTTP server.
  4. PROJECT_VERSION = 2.6.2
  5. PROJECT_REGISTERED = cowboy_clock
  6. # Options.
  7. PLT_APPS = public_key ssl
  8. CT_OPTS += -ct_hooks cowboy_ct_hook [] # -boot start_sasl
  9. # Dependencies.
  10. LOCAL_DEPS = crypto
  11. DEPS = cowlib ranch
  12. dep_cowlib = git https://github.com/ninenines/cowlib 2.7.2
  13. dep_ranch = git https://github.com/ninenines/ranch 1.7.1
  14. DOC_DEPS = asciideck
  15. TEST_DEPS = $(if $(CI_ERLANG_MK),ci.erlang.mk) ct_helper gun proper
  16. dep_ct_helper = git https://github.com/extend/ct_helper master
  17. dep_gun = git https://github.com/ninenines/gun 1.2.0
  18. # CI configuration.
  19. dep_ci.erlang.mk = git https://github.com/ninenines/ci.erlang.mk master
  20. DEP_EARLY_PLUGINS = ci.erlang.mk
  21. AUTO_CI_OTP ?= OTP-19+
  22. AUTO_CI_HIPE ?= OTP-LATEST
  23. # AUTO_CI_ERLLVM ?= OTP-LATEST
  24. AUTO_CI_WINDOWS ?= OTP-19+
  25. # Standard targets.
  26. include erlang.mk
  27. # Don't run the examples test suite by default.
  28. ifndef FULL
  29. CT_SUITES := $(filter-out examples ws_autobahn,$(CT_SUITES))
  30. endif
  31. # Compile options.
  32. ERLC_OPTS += +warn_missing_spec +warn_untyped_record
  33. TEST_ERLC_OPTS += +'{parse_transform, eunit_autoexport}'
  34. # Generate rebar.config on build.
  35. app:: rebar.config
  36. # Dialyze the tests.
  37. DIALYZER_OPTS += --src -r test
  38. # h2spec setup.
  39. GOPATH := $(ERLANG_MK_TMP)/gopath
  40. export GOPATH
  41. H2SPEC := $(GOPATH)/src/github.com/summerwind/h2spec/h2spec
  42. export H2SPEC
  43. # @todo It would be better to allow these dependencies to be specified
  44. # on a per-target basis instead of for all targets.
  45. test-build:: $(H2SPEC)
  46. $(H2SPEC):
  47. $(gen_verbose) mkdir -p $(GOPATH)/src/github.com/summerwind
  48. $(verbose) git clone --depth 1 https://github.com/summerwind/h2spec $(dir $(H2SPEC)) || true
  49. $(verbose) $(MAKE) -C $(dir $(H2SPEC)) build MAKEFLAGS= || true
  50. # Use erl_make_certs from the tested release during CI
  51. # and ensure that ct_helper is always recompiled.
  52. ci-setup:: clean deps test-deps
  53. $(gen_verbose) cp ~/.kerl/builds/$(CI_OTP_RELEASE)/otp_src_git/lib/ssl/test/erl_make_certs.erl deps/ct_helper/src/ || true
  54. $(gen_verbose) $(MAKE) -C $(DEPS_DIR)/ct_helper clean app
  55. # Prepare for the release.
  56. prepare_tag:
  57. $(verbose) echo -n "Most recent tag: "
  58. $(verbose) git tag | tail -n1
  59. $(verbose) git verify-tag `git tag | tail -n1`
  60. $(verbose) echo -n "MAKEFILE: "
  61. $(verbose) grep -m1 PROJECT_VERSION Makefile
  62. $(verbose) echo -n "APP: "
  63. $(verbose) grep -m1 vsn ebin/$(PROJECT).app | sed 's/ //g'
  64. $(verbose) echo -n "GUIDE: "
  65. $(verbose) grep -h dep_$(PROJECT)_commit doc/src/guide/*.asciidoc || true
  66. $(verbose) echo
  67. $(verbose) echo "Titles in most recent CHANGELOG:"
  68. $(verbose) for f in `ls -r doc/src/guide/migrating_from_*.asciidoc | head -n1`; do \
  69. echo $$f:; \
  70. grep == $$f; \
  71. done
  72. $(verbose) echo
  73. $(verbose) echo "Dependencies:"
  74. $(verbose) grep ^DEPS Makefile || echo "DEPS ="
  75. $(verbose) grep ^dep_ Makefile || true
  76. $(verbose) echo
  77. $(verbose) echo "rebar.config:"
  78. $(verbose) cat rebar.config || true