summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorSiri Reiter <siri@pjones.dk>2021-03-29 18:16:04 +0200
committerSiri Reiter <siri@pjones.dk>2021-03-29 18:16:04 +0200
commit4fd15cf1abad0df96a4f6da20db1e68c917094eb (patch)
tree3da951dd3d5b91a1d3b75612bad0b6517ed85395 /Makefile
parente7433c6b139610ca6f81434e3fa39aaeb8bd352b (diff)
parent54989cc1649701a57d7ca5ad99fe32acdb0e7c3f (diff)
Merge remote-tracking branch 'jones/couchdesign/bullseye-da'
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile27
1 files changed, 13 insertions, 14 deletions
diff --git a/Makefile b/Makefile
index 4f99a5e..17cc5ec 100644
--- a/Makefile
+++ b/Makefile
@@ -25,6 +25,8 @@ always-make = $(findstring B,$(MAKEFLAGS))
avoid-broken-git = $(shell cd content && git symbolic-ref -q HEAD > /dev/null || echo " --no-rcs")
iki_configfiles := $(or $(patsubst %.in,%,$(wildcard config/ikiwiki*.setup.in)),config/ikiwiki.setup)
+iki_projects = $(patsubst config/%.setup,build-iki/%,$(iki_configfiles))
+form_projects := $(patsubst forms/%.cgi,build-form/%,$(wildcard forms/*.cgi forms/*/*.cgi))
init: shared/.git content
$(MAKE) $(iki_configfiles)
@@ -54,18 +56,15 @@ content:
$(if $(notempty),,mkdir -p '$@')
$(if $(notempty),,printf '# Hello world!\n\nHello world!\n' > '$@/index.mdwn')
-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);)
- 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))
+build: $(iki_projects) $(form_projects)
+$(iki_projects): build-iki/%: config/%.setup $(cssprojects)
+ ikiwiki --setup $<$(avoid-broken-git)$(if $(always-make), --rebuild, --refresh)
+$(form_projects): build-form/%: forms/%.cgi build-iki/ikiwiki
+ install -DT $< build/$<
+ perl -i -pe "s:'../build:'$(CURDIR)/build:g" build/$<
+ cp -f build/html/$*/index.html build/html/$*/index.tmpl
+ FORMBUILDER_NOHEADER=1 build/$< > build/html/$*/index.html~
+ mv -f build/html/$*/index.html~ build/html/$*/index.html
+ rm build/html/$*/index.tmpl
-.PHONY: all build configfiles
+.PHONY: all build build-iki/% build-form/% configfiles