Makefile 1.2 KB

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