Makefile 1.2 KB

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