Makefile 3.2 KB

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