summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2011-01-30 16:03:45 +0100
committerJonas Smedegaard <dr@jones.dk>2011-01-30 16:04:00 +0100
commit05169c2a79649f8e61464aae1f105f86d4f2b17f (patch)
tree59868f971e2da8dd29cc3d102d6d035b7e69dfdd
parent64bb4701a1c1a2677af7b7407f90f10fcb51c92d (diff)
Avoid invoking init target by default, and have it fully bootstrap, optionally extended.
-rw-r--r--Makefile24
1 files changed, 20 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 603814c..43db4bf 100644
--- a/Makefile
+++ b/Makefile
@@ -1,11 +1,27 @@
+IKIWIKI_OPTIONS ?= \
+ --set srcdir=$(CURDIR)/content \
+ --set destdir=$(CURDIR)/build/html
+
+-include shared/include.mk
+-include config/include.mk
+
all: build
-init:
+init: submodules config content
+
+submodules:
git submodule init
git submodule update --init --recursive
- touch $@
-build: init
+config:
+ mkdir -p "$@"
+ [ -e "$@/ikiwiki.setup" ] || ikiwiki $(IKIWIKI_OPTIONS) --dumpsetup "$@/ikiwiki.setup"
+
+content:
+ mkdir -p "$@"
+ [ -e "$@/index.mdwn" ] || printf "# Hello world!\n\nHello world!\n" > "$@/index.mdwn"
+
+build: config
find config -name '*.setup' -exec ikiwiki --setup '{}' --rebuild ';'
-.PHONY: all init build
+.PHONY: all build submodules