Makefile 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. # See LICENSE for licensing information.
  2. PROJECT = cowlib
  3. PLT_APPS = crypto
  4. CI_OTP = OTP_R15B OTP_R15B01 OTP_R15B02 OTP_R15B03-1 OTP_R16B OTP_R16B01 OTP_R16B02 OTP_R16B03-1 OTP-17.0.2 OTP-17.1.2 OTP-17.2.2 OTP-17.3.4 OTP-17.4.1 OTP-17.5.6.3 OTP-18.0.3
  5. include erlang.mk
  6. TEST_ERLC_OPTS += +'{parse_transform, eunit_autoexport}' -DEXTRA=1
  7. .PHONY: gen perfs
  8. # Mimetypes module generator.
  9. GEN_URL = http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types
  10. GEN_SRC = src/cow_mimetypes.erl.src
  11. GEN_OUT = src/cow_mimetypes.erl
  12. gen:
  13. $(gen_verbose) cat $(GEN_SRC) \
  14. | head -n `grep -n "%% GENERATED" $(GEN_SRC) | cut -d : -f 1` \
  15. > $(GEN_OUT)
  16. $(gen_verbose) wget -qO - $(GEN_URL) \
  17. | grep -v ^# \
  18. | awk '{for (i=2; i<=NF; i++) if ($$i != "") { \
  19. split($$1, a, "/"); \
  20. print "all_ext(<<\"" $$i "\">>) -> {<<\"" \
  21. a[1] "\">>, <<\"" a[2] "\">>, []};"}}' \
  22. | sort \
  23. | uniq -w 25 \
  24. >> $(GEN_OUT)
  25. $(gen_verbose) cat $(GEN_SRC) \
  26. | tail -n +`grep -n "%% GENERATED" $(GEN_SRC) | cut -d : -f 1` \
  27. >> $(GEN_OUT)
  28. # Performance testing.
  29. deps/horse:
  30. git clone -n -- https://github.com/extend/horse $(DEPS_DIR)/horse
  31. cd $(DEPS_DIR)/horse ; git checkout -q master
  32. $(MAKE) -C $(DEPS_DIR)/horse
  33. perfs: ERLC_OPTS += -DPERF=1 +'{parse_transform, horse_autoexport}' -DEXTRA=1
  34. perfs: clean deps deps/horse app
  35. $(gen_verbose) erl -noshell -pa ebin deps/horse/ebin \
  36. -eval 'horse:app_perf($(PROJECT)), init:stop().'