Makefile 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. TEST_ERLC_OPTS += +'{parse_transform, eunit_autoexport}' +'{parse_transform, horse_autoexport}'
  14. TEST_DEPS = horse triq
  15. dep_horse = git https://github.com/extend/horse master
  16. dep_triq = git https://github.com/krestenkrab/triq master
  17. include erlang.mk
  18. .PHONY: gen perfs
  19. # Mimetypes module generator.
  20. GEN_URL = http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types
  21. GEN_SRC = src/cow_mimetypes.erl.src
  22. GEN_OUT = src/cow_mimetypes.erl
  23. gen:
  24. $(gen_verbose) cat $(GEN_SRC) \
  25. | head -n `grep -n "%% GENERATED" $(GEN_SRC) | cut -d : -f 1` \
  26. > $(GEN_OUT)
  27. $(gen_verbose) wget -qO - $(GEN_URL) \
  28. | grep -v ^# \
  29. | awk '{for (i=2; i<=NF; i++) if ($$i != "") { \
  30. split($$1, a, "/"); \
  31. print "all_ext(<<\"" $$i "\">>) -> {<<\"" \
  32. a[1] "\">>, <<\"" a[2] "\">>, []};"}}' \
  33. | sort \
  34. | uniq -w 25 \
  35. >> $(GEN_OUT)
  36. $(gen_verbose) cat $(GEN_SRC) \
  37. | tail -n +`grep -n "%% GENERATED" $(GEN_SRC) | cut -d : -f 1` \
  38. >> $(GEN_OUT)
  39. # Performance testing.
  40. ifeq ($(MAKECMDGOALS),perfs)
  41. .NOTPARALLEL:
  42. endif
  43. perfs: test-build
  44. $(gen_verbose) erl -noshell -pa ebin deps/horse/ebin \
  45. -eval 'horse:app_perf($(PROJECT)), erlang:halt().'