Makefile 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. manifests = lighttpd.manifest lighttpd-angel.manifest
  2. SRCDIR = lighttpd-1.4.30
  3. HOST = $(firstword $(shell ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' -m 1 | cut -d: -f2))
  4. PORT = 8000
  5. CORES = 4
  6. THREADS = 25
  7. conf_files = lighttpd-server.conf lighttpd.conf lighttpd-multithreaded.conf
  8. target = build-lighttpd $(conf_files) test-data
  9. exec_target = $(manifests)
  10. clean-extra = clean-others
  11. extra_rules = -e 's:\$$(HOST):$(HOST):g' -e 's:\$$(PORT):$(PORT):g'
  12. level = ../../
  13. include ../../Makefile
  14. build-lighttpd: build/sbin/lighttpd
  15. build/sbin/lighttpd: $(SRCDIR)
  16. cd $(SRCDIR) && ./configure --prefix=$(PWD)/build \
  17. --without-openssl --without-pcre --without-zlib --without-bzip2
  18. $(MAKE) -C $(SRCDIR)
  19. $(MAKE) -C $(SRCDIR) install
  20. $(SRCDIR): %: %.tar.gz
  21. tar -xzf $<
  22. lighttpd-server.conf:
  23. rm -rf $@
  24. echo "server.document-root = \"$(PWD)/html\"" >> $@
  25. echo "server.port = $(PORT)" >> $@
  26. echo "server.bind = \"$(HOST)\"" >> $@
  27. lighttpd.conf:
  28. rm -rf $@
  29. echo "include \"lighttpd-server.conf\"" >> $@
  30. echo "include \"lighttpd-generic.conf\"" >> $@
  31. lighttpd-multithreaded.conf:
  32. rm -rf $@
  33. echo "include \"lighttpd-server.conf\"" >> $@
  34. echo "server.max-worker = $(THREADS)" >> $@
  35. echo "include \"lighttpd-generic.conf\"" >> $@
  36. start-native-server:
  37. $(PREFIX) build/sbin/lighttpd -D -m build/lib -f \
  38. $(if $(CONF),$(CONF),lighttpd.conf)
  39. start-multithreaded-native-server:
  40. $(PREFIX) build/sbin/lighttpd -D -m build/lib -f \
  41. $(if $(CONF),$(CONF),lighttpd-multithreaded.conf)
  42. start-graphene-server:
  43. $(PREFIX) ./lighttpd.manifest -D -m /lighttpd -f \
  44. $(if $(CONF),$(CONF),lighttpd.conf)
  45. start-multithreaded-graphene-server:
  46. $(PREFIX) ./lighttpd.manifest -D -m /lighttpd -f \
  47. $(if $(CONF),$(CONF),lighttpd-multithreaded.conf)
  48. random-data = $(foreach n,1 2 3 4 5 6 7 8 9 10,2K.$n.html) \
  49. $(foreach n,1 2 3 4 5,10K.$n.html) \
  50. $(foreach n,1 2 3 4 5,100K.$n.html) \
  51. $(foreach n,1 2 3,1M.$n.html) \
  52. $(foreach n,1 2 3,10M.$n.html) \
  53. $(foreach n,1 2 3,100.$n.html)
  54. test-data = html/oscar-web html/oscar-web-static html/random \
  55. $(addprefix html/random/,$(random-data))
  56. html/%: ../web-data/%.tar.gz
  57. [ -d "$@" ] || (cd $(dir $@) && tar -xzf ../$^)
  58. html/random:
  59. mkdir -p $@
  60. html/random/%.html: html/random
  61. dd if=/dev/urandom of=$@ count=1 bs=$(basename $(basename $(notdir $@)))
  62. test-data: $(test-data)
  63. distclean: clean
  64. rm -rf build $(SRCDIR)
  65. clean-others:
  66. rm -rf $(conf_files) $(test-data)