1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- manifests = lighttpd.manifest lighttpd-angel.manifest
- SRCDIR = lighttpd-1.4.30
- HOST = $(firstword $(shell ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' -m 1 | cut -d: -f2))
- PORT = 8000
- CORES = 4
- THREADS = 25
- conf_files = lighttpd-server.conf lighttpd.conf lighttpd-multithreaded.conf
- target = build-lighttpd $(conf_files) test-data
- exec_target = $(manifests)
- clean-extra = clean-others
- extra_rules = -e 's:\$$(HOST):$(HOST):g' -e 's:\$$(PORT):$(PORT):g'
- level = ../../
- include ../../Makefile
- build-lighttpd: build/sbin/lighttpd
- build/sbin/lighttpd: $(SRCDIR)
- cd $(SRCDIR) && ./configure --prefix=$(PWD)/build \
- --without-openssl --without-pcre --without-zlib --without-bzip2
- $(MAKE) -C $(SRCDIR)
- $(MAKE) -C $(SRCDIR) install
- $(SRCDIR): %: %.tar.gz
- tar -xzf $<
- lighttpd-server.conf:
- rm -rf $@
- echo "server.document-root = \"$(PWD)/html\"" >> $@
- echo "server.port = $(PORT)" >> $@
- echo "server.bind = \"$(HOST)\"" >> $@
- lighttpd.conf:
- rm -rf $@
- echo "include \"lighttpd-server.conf\"" >> $@
- echo "include \"lighttpd-generic.conf\"" >> $@
- lighttpd-multithreaded.conf:
- rm -rf $@
- echo "include \"lighttpd-server.conf\"" >> $@
- echo "server.max-worker = $(THREADS)" >> $@
- echo "include \"lighttpd-generic.conf\"" >> $@
- start-native-server:
- $(PREFIX) build/sbin/lighttpd -D -m build/lib -f \
- $(if $(CONF),$(CONF),lighttpd.conf)
- start-multithreaded-native-server:
- $(PREFIX) build/sbin/lighttpd -D -m build/lib -f \
- $(if $(CONF),$(CONF),lighttpd-multithreaded.conf)
- start-graphene-server:
- $(PREFIX) ./lighttpd.manifest -D -m /lighttpd -f \
- $(if $(CONF),$(CONF),lighttpd.conf)
- start-multithreaded-graphene-server:
- $(PREFIX) ./lighttpd.manifest -D -m /lighttpd -f \
- $(if $(CONF),$(CONF),lighttpd-multithreaded.conf)
- random-data = $(foreach n,1 2 3 4 5 6 7 8 9 10,2K.$n.html) \
- $(foreach n,1 2 3 4 5,10K.$n.html) \
- $(foreach n,1 2 3 4 5,100K.$n.html) \
- $(foreach n,1 2 3,1M.$n.html) \
- $(foreach n,1 2 3,10M.$n.html) \
- $(foreach n,1 2 3,100.$n.html)
- test-data = html/oscar-web html/oscar-web-static html/random \
- $(addprefix html/random/,$(random-data))
- html/%: ../web-data/%.tar.gz
- [ -d "$@" ] || (cd $(dir $@) && tar -xzf ../$^)
- html/random:
- mkdir -p $@
- html/random/%.html: html/random
- dd if=/dev/urandom of=$@ count=1 bs=$(basename $(basename $(notdir $@)))
- test-data: $(test-data)
- distclean: clean
- rm -rf build $(SRCDIR)
- clean-others:
- rm -rf $(conf_files) $(test-data)
|