summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2017-04-05 20:21:07 +0200
committerJonas Smedegaard <dr@jones.dk>2017-04-05 20:21:07 +0200
commite13e7ae2bf9ae571d02a64c4b6dd5eca646e39e4 (patch)
treed19f529116515a11c3ca95ac2db0df5259d92c3a
parent4e65733a77946659116a8930b960e85752bcfb23 (diff)
Inject forms into built pages.
-rw-r--r--Makefile5
1 files changed, 4 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index adedae8..59c7274 100644
--- a/Makefile
+++ b/Makefile
@@ -58,6 +58,9 @@ build:
set -e;\
$(foreach path,$(patsubst forms/%,%,$(wildcard forms/*.cgi forms/*/*.cgi)),\
install -DT 'forms/$(path)' 'build/forms/$(path)'; \
- perl -i -pe "s:'../build':'$(CURDIR)/build':g" 'build/forms/$(path)';)
+ perl -i -pe "s:'../build':'$(CURDIR)/build':g" 'build/forms/$(path)';\
+ $(foreach htmlstempath,$(path:%.cgi=build/html/%),\
+ $(if $(wildcard $(htmlstempath).tmpl),,cp $(htmlstempath).html $(htmlstempath).tmpl;)\
+ 'build/forms/$(path)' > $(htmlstempath).html))
.PHONY: all build configfiles