Makefile 1.4 KB

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