Makefile 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. # See LICENSE for licensing information.
  2. PROJECT = cowlib
  3. PROJECT_DESCRIPTION = Support library for manipulating Web protocols.
  4. PROJECT_VERSION = 2.0.1
  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 = 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. # Standard targets.
  23. include erlang.mk
  24. # Compile options.
  25. TEST_ERLC_OPTS += +'{parse_transform, eunit_autoexport}' +'{parse_transform, horse_autoexport}'
  26. # Mimetypes module generator.
  27. GEN_URL = http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types
  28. GEN_SRC = src/cow_mimetypes.erl.src
  29. GEN_OUT = src/cow_mimetypes.erl
  30. .PHONY: gen
  31. gen:
  32. $(gen_verbose) cat $(GEN_SRC) \
  33. | head -n `grep -n "%% GENERATED" $(GEN_SRC) | cut -d : -f 1` \
  34. > $(GEN_OUT)
  35. $(gen_verbose) wget -qO - $(GEN_URL) \
  36. | grep -v ^# \
  37. | awk '{for (i=2; i<=NF; i++) if ($$i != "") { \
  38. split($$1, a, "/"); \
  39. print "all_ext(<<\"" $$i "\">>) -> {<<\"" \
  40. a[1] "\">>, <<\"" a[2] "\">>, []};"}}' \
  41. | sort \
  42. | uniq -w 25 \
  43. >> $(GEN_OUT)
  44. $(gen_verbose) cat $(GEN_SRC) \
  45. | tail -n +`grep -n "%% GENERATED" $(GEN_SRC) | cut -d : -f 1` \
  46. >> $(GEN_OUT)
  47. # Performance testing.
  48. ifeq ($(MAKECMDGOALS),perfs)
  49. .NOTPARALLEL:
  50. endif
  51. .PHONY: perfs
  52. perfs: test-build
  53. $(gen_verbose) erl -noshell -pa ebin -eval 'horse:app_perf($(PROJECT)), erlang:halt().'