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