box-o-sand/web/Makefile

30 lines
521 B
Makefile

ROOT ?= $(PWD)
HTTP_PORT ?= 49228
NGINX_CONF_IN := nginx.conf.in
ALL_NGINX_CONF_INPUTS := \
$(NGINX_CONF_IN) \
$(wildcard perl_requirements.d/*) \
$(wildcard perl_locations.d/*)
serve: nginx.conf
nginx -p $(ROOT)/ -c $(ROOT)/$<
nginx.conf: $(ALL_NGINX_CONF_INPUTS)
cat $< | \
sed -e 's@__ROOT__@$(ROOT)@g' \
-e 's@__HTTP_PORT__@$(HTTP_PORT)@g' > $@
serve-cgiwrap: cgiwrap-fcgi.pl
perl $<
cgiwrap-fcgi.pl: cgiwrap-fcgi.pl.in
cat $< | sed -e 's@__ROOT__@$(ROOT)@g' > $@
.PHONY: serve serve-cgiwrap