summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2017-04-18 20:56:40 +0200
committerJonas Smedegaard <dr@jones.dk>2017-04-18 21:25:30 +0200
commitdf80b903ce93295c030f2a185d68686216cbdb3b (patch)
tree84ebc8906f6342b445074914c97816dff2f9ee05
parent8f6e11670c485cc3316ead626c0a126f86df5e0c (diff)
Improve forms handling.
-rw-r--r--Makefile12
1 files changed, 9 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index b554734..1611825 100644
--- a/Makefile
+++ b/Makefile
@@ -56,8 +56,14 @@ build:
$(if $(cssprojects),$(MAKE) $(cssprojects))
set -e;\
$(foreach config,$(shell find config -name '*.setup'),ikiwiki --setup $(config)$(avoid-broken-git)$(if $(always-make), --rebuild, --refresh);)
- $(if $(wildcard forms),cd forms && find * -name '*.cgi' \
- -exec install -DT '{}' ../build/forms/'{}' ';' \
- -exec perl -i -pe "s:'../build':'$(CURDIR)/build':g" ../build/forms/'{}' ';')
+ 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)';\
+ $(foreach htmlstempath,$(path:%.cgi=build/html/%),\
+ cp -f $(htmlstempath).html $(htmlstempath).tmpl;\
+ FORMBUILDER_NOHEADER=1 'build/forms/$(path)' > $(htmlstempath).html~;\
+ mv -f $(htmlstempath).html~ $(htmlstempath).html;\
+ rm $(htmlstempath).tmpl))
.PHONY: all build configfiles