Makefile 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. # See LICENSE for licensing information.
  2. PROJECT = cowlib
  3. PROJECT_DESCRIPTION = Support library for manipulating Web protocols.
  4. PROJECT_VERSION = 1.3.0
  5. #ERLC_OPTS += +bin_opt_info
  6. ifdef HIPE
  7. ERLC_OPTS += -smp +native
  8. TEST_ERLC_OPTS += -smp +native
  9. endif
  10. LOCAL_DEPS = crypto
  11. DIALYZER_OPTS = -Werror_handling -Wunmatched_returns
  12. CI_OTP ?= OTP-18.0.3 OTP-18.1.5 OTP-18.2.4.1 OTP-18.3.4.4 OTP-19.0.7 OTP-19.1.5
  13. CI_HIPE ?= OTP-19.1.5
  14. CI_HIPE_LLVM ?= $(CI_HIPE)
  15. TEST_ERLC_OPTS += +'{parse_transform, eunit_autoexport}' +'{parse_transform, horse_autoexport}'
  16. TEST_DEPS = horse triq
  17. dep_horse = git https://github.com/extend/horse master
  18. dep_triq = git https://github.com/krestenkrab/triq master
  19. include erlang.mk
  20. .PHONY: gen perfs
  21. # Mimetypes module generator.
  22. GEN_URL = http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types
  23. GEN_SRC = src/cow_mimetypes.erl.src
  24. GEN_OUT = src/cow_mimetypes.erl
  25. gen:
  26. $(gen_verbose) cat $(GEN_SRC) \
  27. | head -n `grep -n "%% GENERATED" $(GEN_SRC) | cut -d : -f 1` \
  28. > $(GEN_OUT)
  29. $(gen_verbose) wget -qO - $(GEN_URL) \
  30. | grep -v ^# \
  31. | awk '{for (i=2; i<=NF; i++) if ($$i != "") { \
  32. split($$1, a, "/"); \
  33. print "all_ext(<<\"" $$i "\">>) -> {<<\"" \
  34. a[1] "\">>, <<\"" a[2] "\">>, []};"}}' \
  35. | sort \
  36. | uniq -w 25 \
  37. >> $(GEN_OUT)
  38. $(gen_verbose) cat $(GEN_SRC) \
  39. | tail -n +`grep -n "%% GENERATED" $(GEN_SRC) | cut -d : -f 1` \
  40. >> $(GEN_OUT)
  41. # Performance testing.
  42. ifeq ($(MAKECMDGOALS),perfs)
  43. .NOTPARALLEL:
  44. endif
  45. perfs: test-build
  46. $(gen_verbose) erl -noshell -pa ebin deps/horse/ebin \
  47. -eval 'horse:app_perf($(PROJECT)), erlang:halt().'