Makefile 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. # See LICENSE for licensing information.
  2. PROJECT = cowboy
  3. PROJECT_DESCRIPTION = Small, fast, modern HTTP server.
  4. PROJECT_VERSION = 2.10.0
  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 qpack
  13. dep_ranch = git https://github.com/ninenines/ranch 1.8.0
  14. # @todo Only if COWBOY_QUICER is set.
  15. DEPS += quicer
  16. dep_quicer = git https://github.com/emqx/quic main
  17. DOC_DEPS = asciideck
  18. TEST_DEPS = $(if $(CI_ERLANG_MK),ci.erlang.mk) ct_helper gun
  19. dep_ct_helper = git https://github.com/extend/ct_helper master
  20. dep_gun = git https://github.com/ninenines/gun master
  21. # CI configuration.
  22. dep_ci.erlang.mk = git https://github.com/ninenines/ci.erlang.mk master
  23. DEP_EARLY_PLUGINS = ci.erlang.mk
  24. AUTO_CI_OTP ?= OTP-LATEST-22+
  25. AUTO_CI_HIPE ?= OTP-LATEST
  26. # AUTO_CI_ERLLVM ?= OTP-LATEST
  27. AUTO_CI_WINDOWS ?= OTP-LATEST-22+
  28. # Hex configuration.
  29. define HEX_TARBALL_EXTRA_METADATA
  30. #{
  31. licenses => [<<"ISC">>],
  32. links => #{
  33. <<"User guide">> => <<"https://ninenines.eu/docs/en/cowboy/2.10/guide/">>,
  34. <<"Function reference">> => <<"https://ninenines.eu/docs/en/cowboy/2.10/manual/">>,
  35. <<"GitHub">> => <<"https://github.com/ninenines/cowboy">>,
  36. <<"Sponsor">> => <<"https://github.com/sponsors/essen">>
  37. }
  38. }
  39. endef
  40. # Standard targets.
  41. include erlang.mk
  42. # Don't run the examples test suite by default.
  43. ifndef FULL
  44. CT_SUITES := $(filter-out examples ws_autobahn,$(CT_SUITES))
  45. endif
  46. # Compile options.
  47. ERLC_OPTS += +warn_missing_spec +warn_untyped_record # +bin_opt_info
  48. TEST_ERLC_OPTS += +'{parse_transform, eunit_autoexport}'
  49. # Generate rebar.config on build.
  50. app:: rebar.config
  51. # Fix quicer compilation for HTTP/3.
  52. autopatch-quicer::
  53. $(verbose) printf "%s\n" "all: ;" > $(DEPS_DIR)/quicer/c_src/Makefile.erlang.mk
  54. # Dialyze the tests.
  55. DIALYZER_OPTS += --src -r test
  56. # h2spec setup.
  57. GOPATH := $(ERLANG_MK_TMP)/gopath
  58. export GOPATH
  59. H2SPEC := $(GOPATH)/src/github.com/summerwind/h2spec/h2spec
  60. export H2SPEC
  61. # @todo It would be better to allow these dependencies to be specified
  62. # on a per-target basis instead of for all targets.
  63. test-build:: $(H2SPEC)
  64. $(H2SPEC):
  65. $(gen_verbose) mkdir -p $(GOPATH)/src/github.com/summerwind
  66. $(verbose) git clone --depth 1 https://github.com/summerwind/h2spec $(dir $(H2SPEC)) || true
  67. $(verbose) $(MAKE) -C $(dir $(H2SPEC)) build MAKEFLAGS= || true
  68. # Prepare for the release.
  69. prepare_tag:
  70. $(verbose) $(warning Hex metadata: $(HEX_TARBALL_EXTRA_METADATA))
  71. $(verbose) echo
  72. $(verbose) echo -n "Most recent tag: "
  73. $(verbose) git tag --sort taggerdate | tail -n1
  74. $(verbose) git verify-tag `git tag --sort taggerdate | tail -n1`
  75. $(verbose) echo -n "MAKEFILE: "
  76. $(verbose) grep -m1 PROJECT_VERSION Makefile
  77. $(verbose) echo -n "APP: "
  78. $(verbose) grep -m1 vsn ebin/$(PROJECT).app | sed 's/ //g'
  79. $(verbose) echo -n "GUIDE: "
  80. $(verbose) grep -h dep_$(PROJECT)_commit doc/src/guide/*.asciidoc || true
  81. $(verbose) echo
  82. $(verbose) echo "Titles in most recent CHANGELOG:"
  83. $(verbose) for f in `ls -r doc/src/guide/migrating_from_*.asciidoc | head -n1`; do \
  84. echo $$f:; \
  85. grep == $$f; \
  86. done
  87. $(verbose) echo
  88. $(verbose) echo "Dependencies:"
  89. $(verbose) grep ^DEPS Makefile || echo "DEPS ="
  90. $(verbose) grep ^dep_ Makefile || true
  91. $(verbose) echo
  92. $(verbose) echo "rebar.config:"
  93. $(verbose) cat rebar.config || true