summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile15
1 files changed, 10 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 4e287aa..1fb0d33 100644
--- a/Makefile
+++ b/Makefile
@@ -25,19 +25,24 @@ avoid-broken-git = $(shell cd content && git symbolic-ref -q HEAD > /dev/null ||
iki_configfiles := $(or $(patsubst %.in,%,$(wildcard config/ikiwiki*.setup.in)),config/ikiwiki.setup)
-init: $(iki_configfiles) content
+init: shared/.git content
+ $(MAKE) $(iki_configfiles)
shared/.git:
git submodule init
git submodule update --init --recursive
-$(iki_configfiles): iki_flavor = $(if $(filter config/ikiwiki-%.setup,$@),$(@:config/ikiwiki-%.setup=%))
-$(iki_configfiles): % : %.in shared/.git
+config/ikiwiki.setup.in:
$(if $(wildcard config),,mkdir config)
+ $(if $(wildcard config/ikiwiki.setup.in),,touch config/ikiwiki.setup.in)
+
+configfiles: $(iki_configfiles)
+$(iki_configfiles): iki_flavor = $(if $(filter config/ikiwiki-%.setup,$@),$(@:config/ikiwiki-%.setup=%))
+$(iki_configfiles): % : %.in
ikiwiki $(IKIWIKI_DEFAULTS) $(patsubst %,--setup %,$(wildcard $<)) $(IKIWIKI_OPTIONS) --dumpsetup $@
content: notempty = $(wildcard $@/*.mdwn)
-content: shared/.git
+content:
$(if $(notempty),,mkdir -p '$@')
$(if $(notempty),,printf '# Hello world!\n\nHello world!\n' > '$@/index.mdwn')
@@ -45,4 +50,4 @@ build:
$(if $(cssprojects),$(MAKE) $(cssprojects))
$(foreach config,$(shell find config -name '*.setup'),ikiwiki --setup $(config)$(avoid-broken-git)$(if $(always-make), --rebuild);)
-.PHONY: all build
+.PHONY: all build configfiles