Makefile 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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. TEST_DEPS = $(if $(CI_ERLANG_MK),ci.erlang.mk) horse proper
  15. dep_horse = git https://github.com/ninenines/horse.git master
  16. # CI configuration.
  17. dep_ci.erlang.mk = git https://github.com/ninenines/ci.erlang.mk master
  18. DEP_EARLY_PLUGINS = ci.erlang.mk
  19. AUTO_CI_OTP ?= OTP-19+
  20. AUTO_CI_HIPE ?= OTP-LATEST
  21. # AUTO_CI_ERLLVM ?= OTP-LATEST
  22. AUTO_CI_WINDOWS ?= OTP-19+
  23. # Standard targets.
  24. include erlang.mk
  25. # Compile options.
  26. TEST_ERLC_OPTS += +'{parse_transform, eunit_autoexport}' +'{parse_transform, horse_autoexport}'
  27. # Mimetypes module generator.
  28. GEN_URL = http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types
  29. GEN_SRC = src/cow_mimetypes.erl.src
  30. GEN_OUT = src/cow_mimetypes.erl
  31. .PHONY: gen
  32. gen:
  33. $(gen_verbose) cat $(GEN_SRC) \
  34. | head -n `grep -n "%% GENERATED" $(GEN_SRC) | cut -d : -f 1` \
  35. > $(GEN_OUT)
  36. $(gen_verbose) wget -qO - $(GEN_URL) \
  37. | grep -v ^# \
  38. | awk '{for (i=2; i<=NF; i++) if ($$i != "") { \
  39. split($$1, a, "/"); \
  40. print "all_ext(<<\"" $$i "\">>) -> {<<\"" \
  41. a[1] "\">>, <<\"" a[2] "\">>, []};"}}' \
  42. | sort \
  43. | uniq -w 25 \
  44. >> $(GEN_OUT)
  45. $(gen_verbose) cat $(GEN_SRC) \
  46. | tail -n +`grep -n "%% GENERATED" $(GEN_SRC) | cut -d : -f 1` \
  47. >> $(GEN_OUT)
  48. # Performance testing.
  49. ifeq ($(MAKECMDGOALS),perfs)
  50. .NOTPARALLEL:
  51. endif
  52. .PHONY: perfs
  53. perfs: test-build
  54. $(gen_verbose) erl -noshell -pa ebin -eval 'horse:app_perf($(PROJECT)), erlang:halt().'
  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
  65. $(verbose) echo "Dependencies:"
  66. $(verbose) grep ^DEPS Makefile || echo "DEPS ="
  67. $(verbose) grep ^dep_ Makefile || true