Makefile 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. # See LICENSE for licensing information.
  2. PROJECT = cowlib
  3. PROJECT_DESCRIPTION = Support library for manipulating Web protocols.
  4. PROJECT_VERSION = 2.7.3
  5. # Options.
  6. #ERLC_OPTS += +bin_opt_info
  7. ifdef HIPE
  8. ERLC_OPTS += -smp +native
  9. TEST_ERLC_OPTS += -smp +native
  10. endif
  11. DIALYZER_OPTS = -Werror_handling -Wunmatched_returns
  12. # Dependencies.
  13. LOCAL_DEPS = crypto
  14. DOC_DEPS = asciideck
  15. TEST_DEPS = $(if $(CI_ERLANG_MK),ci.erlang.mk) horse proper
  16. dep_horse = git https://github.com/ninenines/horse.git master
  17. # CI configuration.
  18. dep_ci.erlang.mk = git https://github.com/ninenines/ci.erlang.mk master
  19. DEP_EARLY_PLUGINS = ci.erlang.mk
  20. AUTO_CI_OTP ?= OTP-20+
  21. AUTO_CI_HIPE ?= OTP-LATEST
  22. # AUTO_CI_ERLLVM ?= OTP-LATEST
  23. AUTO_CI_WINDOWS ?= OTP-20+
  24. # Standard targets.
  25. include erlang.mk
  26. # Compile options.
  27. TEST_ERLC_OPTS += +'{parse_transform, eunit_autoexport}' +'{parse_transform, horse_autoexport}'
  28. # Mimetypes module generator.
  29. GEN_URL = http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types
  30. GEN_SRC = src/cow_mimetypes.erl.src
  31. GEN_OUT = src/cow_mimetypes.erl
  32. .PHONY: gen
  33. gen:
  34. $(gen_verbose) cat $(GEN_SRC) \
  35. | head -n `grep -n "%% GENERATED" $(GEN_SRC) | cut -d : -f 1` \
  36. > $(GEN_OUT)
  37. $(gen_verbose) wget -qO - $(GEN_URL) \
  38. | grep -v ^# \
  39. | awk '{for (i=2; i<=NF; i++) if ($$i != "") { \
  40. split($$1, a, "/"); \
  41. print "all_ext(<<\"" $$i "\">>) -> {<<\"" \
  42. a[1] "\">>, <<\"" a[2] "\">>, []};"}}' \
  43. | sort \
  44. | uniq -w 25 \
  45. >> $(GEN_OUT)
  46. $(gen_verbose) cat $(GEN_SRC) \
  47. | tail -n +`grep -n "%% GENERATED" $(GEN_SRC) | cut -d : -f 1` \
  48. >> $(GEN_OUT)
  49. # Performance testing.
  50. ifeq ($(MAKECMDGOALS),perfs)
  51. .NOTPARALLEL:
  52. endif
  53. .PHONY: perfs
  54. perfs: test-build
  55. $(gen_verbose) erl -noshell -pa ebin -eval 'horse:app_perf($(PROJECT)), erlang:halt().'
  56. # Prepare for the release.
  57. prepare_tag:
  58. $(verbose) echo -n "Most recent tag: "
  59. $(verbose) git tag | tail -n1
  60. $(verbose) git verify-tag `git tag | tail -n1`
  61. $(verbose) echo -n "MAKEFILE: "
  62. $(verbose) grep -m1 PROJECT_VERSION Makefile
  63. $(verbose) echo -n "APP: "
  64. $(verbose) grep -m1 vsn ebin/$(PROJECT).app | sed 's/ //g'
  65. $(verbose) echo
  66. $(verbose) echo "Dependencies:"
  67. $(verbose) grep ^DEPS Makefile || echo "DEPS ="
  68. $(verbose) grep ^dep_ Makefile || true