Makefile 1.3 KB

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