Makefile (3554B)
1 # See LICENSE for licensing information. 2 3 PROJECT = cowboy 4 PROJECT_DESCRIPTION = Small, fast, modern HTTP server. 5 PROJECT_VERSION = 2.9.0 6 PROJECT_REGISTERED = cowboy_clock 7 8 # Options. 9 10 PLT_APPS = public_key ssl 11 CT_OPTS += -ct_hooks cowboy_ct_hook [] # -boot start_sasl 12 13 # Dependencies. 14 15 LOCAL_DEPS = crypto 16 17 DEPS = cowlib ranch 18 dep_cowlib = git https://github.com/ninenines/cowlib 2.11.0 19 dep_ranch = git https://github.com/ninenines/ranch 1.8.0 20 21 DOC_DEPS = asciideck 22 23 TEST_DEPS = $(if $(CI_ERLANG_MK),ci.erlang.mk) ct_helper gun 24 dep_ct_helper = git https://github.com/extend/ct_helper master 25 dep_gun = git https://github.com/ninenines/gun master 26 27 # CI configuration. 28 29 dep_ci.erlang.mk = git https://github.com/ninenines/ci.erlang.mk master 30 DEP_EARLY_PLUGINS = ci.erlang.mk 31 32 AUTO_CI_OTP ?= OTP-LATEST-22+ 33 AUTO_CI_HIPE ?= OTP-LATEST 34 # AUTO_CI_ERLLVM ?= OTP-LATEST 35 AUTO_CI_WINDOWS ?= OTP-LATEST-22+ 36 37 # Hex configuration. 38 39 define HEX_TARBALL_EXTRA_METADATA 40 #{ 41 licenses => [<<"ISC">>], 42 links => #{ 43 <<"User guide">> => <<"https://ninenines.eu/docs/en/cowboy/2.9/guide/">>, 44 <<"Function reference">> => <<"https://ninenines.eu/docs/en/cowboy/2.9/manual/">>, 45 <<"GitHub">> => <<"https://github.com/ninenines/cowboy">>, 46 <<"Sponsor">> => <<"https://github.com/sponsors/essen">> 47 } 48 } 49 endef 50 51 # Standard targets. 52 53 include erlang.mk 54 55 # Don't run the examples test suite by default. 56 57 ifndef FULL 58 CT_SUITES := $(filter-out examples ws_autobahn,$(CT_SUITES)) 59 endif 60 61 # Compile options. 62 63 ERLC_OPTS += +warn_missing_spec +warn_untyped_record # +bin_opt_info 64 TEST_ERLC_OPTS += +'{parse_transform, eunit_autoexport}' 65 66 # Generate rebar.config on build. 67 68 app:: rebar.config 69 70 # Dialyze the tests. 71 72 DIALYZER_OPTS += --src -r test 73 74 # h2spec setup. 75 76 GOPATH := $(ERLANG_MK_TMP)/gopath 77 export GOPATH 78 79 H2SPEC := $(GOPATH)/src/github.com/summerwind/h2spec/h2spec 80 export H2SPEC 81 82 # @todo It would be better to allow these dependencies to be specified 83 # on a per-target basis instead of for all targets. 84 test-build:: $(H2SPEC) 85 86 $(H2SPEC): 87 $(gen_verbose) mkdir -p $(GOPATH)/src/github.com/summerwind 88 $(verbose) git clone --depth 1 https://github.com/summerwind/h2spec $(dir $(H2SPEC)) || true 89 $(verbose) $(MAKE) -C $(dir $(H2SPEC)) build MAKEFLAGS= || true 90 91 # Use erl_make_certs from the tested release during CI 92 # and ensure that ct_helper is always recompiled. 93 94 ci-setup:: clean deps test-deps 95 $(gen_verbose) cp ~/.kerl/builds/$(CI_OTP_RELEASE)/otp_src_git/lib/ssl/test/erl_make_certs.erl deps/ct_helper/src/ || true 96 $(gen_verbose) $(MAKE) -C $(DEPS_DIR)/ct_helper clean app 97 98 # Prepare for the release. 99 100 prepare_tag: 101 $(verbose) $(warning Hex metadata: $(HEX_TARBALL_EXTRA_METADATA)) 102 $(verbose) echo 103 $(verbose) echo -n "Most recent tag: " 104 $(verbose) git tag --sort taggerdate | tail -n1 105 $(verbose) git verify-tag `git tag --sort taggerdate | tail -n1` 106 $(verbose) echo -n "MAKEFILE: " 107 $(verbose) grep -m1 PROJECT_VERSION Makefile 108 $(verbose) echo -n "APP: " 109 $(verbose) grep -m1 vsn ebin/$(PROJECT).app | sed 's/ //g' 110 $(verbose) echo -n "GUIDE: " 111 $(verbose) grep -h dep_$(PROJECT)_commit doc/src/guide/*.asciidoc || true 112 $(verbose) echo 113 $(verbose) echo "Titles in most recent CHANGELOG:" 114 $(verbose) for f in `ls -r doc/src/guide/migrating_from_*.asciidoc | head -n1`; do \ 115 echo $$f:; \ 116 grep == $$f; \ 117 done 118 $(verbose) echo 119 $(verbose) echo "Dependencies:" 120 $(verbose) grep ^DEPS Makefile || echo "DEPS =" 121 $(verbose) grep ^dep_ Makefile || true 122 $(verbose) echo 123 $(verbose) echo "rebar.config:" 124 $(verbose) cat rebar.config || true