summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile10
1 files changed, 6 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 4e287aa..dd996fe 100644
--- a/Makefile
+++ b/Makefile
@@ -25,19 +25,21 @@ 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
+configfiles: $(iki_configfiles)
$(iki_configfiles): iki_flavor = $(if $(filter config/ikiwiki-%.setup,$@),$(@:config/ikiwiki-%.setup=%))
-$(iki_configfiles): % : %.in shared/.git
+$(iki_configfiles): % : %.in
$(if $(wildcard config),,mkdir config)
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 +47,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