Makefile 751 B

123456789101112131415161718192021222324252627
  1. # See LICENSE for licensing information.
  2. PROJECT = cowlib
  3. CT_SUITES = eunit
  4. include erlang.mk
  5. GEN_URL = http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types
  6. GEN_SRC = src/cow_mimetypes.erl.src
  7. GEN_OUT = src/cow_mimetypes.erl
  8. gen:
  9. $(gen_verbose) cat $(GEN_SRC) \
  10. | head -n `grep -n "%% GENERATED" $(GEN_SRC) | cut -d : -f 1` \
  11. > $(GEN_OUT)
  12. $(gen_verbose) wget -qO - $(GEN_URL) \
  13. | grep -v ^# \
  14. | awk '{for (i=2; i<=NF; i++) if ($$i != "") { \
  15. split($$1, a, "/"); \
  16. print "all_ext(<<\"" $$i "\">>) -> {<<\"" \
  17. a[1] "\">>, <<\"" a[2] "\">>, []};"}}' \
  18. | sort \
  19. | uniq -w 25 \
  20. >> $(GEN_OUT)
  21. $(gen_verbose) cat $(GEN_SRC) \
  22. | tail -n +`grep -n "%% GENERATED" $(GEN_SRC) | cut -d : -f 1` \
  23. >> $(GEN_OUT)