summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore6
-rw-r--r--Makefile29
2 files changed, 35 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..658803e
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,6 @@
+/basewiki
+/basewiki_l10n
+/smiley
+/smiley_l10n
+/templates
+/templates_l10n
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..09a99c4
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,29 @@
+sources = ikiwiki
+
+origin_ikiwiki = http://source.jones.dk/ikiwiki_$(underlay).git
+underlays_ikiwiki = basewiki smiley templates
+master_ikiwiki = master$(locale:%=-$(locale))
+
+locales = danish
+
+underlays_l10n = $(foreach source, $(sources), $(foreach locale, $(locales), $(patsubst %,%_l10n/$(locale),$(underlays_$(source)))))
+underlays = $(foreach source, $(sources), $(underlays_$(source))) $(underlays_l10n)
+
+source_of_underlay = $(firstword $(foreach source, $(sources), $(if $(filter $(underlay),$(underlays_$(source))),$(source))))
+origin = $(origin_$(source_of_underlay))
+master = $(master_$(source_of_underlay))
+
+all: $(underlays)
+
+$(underlays): locale=$(if $(filter l10n/,$(lastword $(subst _, ,$(dir $@)))),$(notdir $@))
+$(underlays): underlay=$(@:%_l10n/$(locale)=%)
+$(underlays):
+ mkdir -p $@
+ cd $@ && git init
+ cd $@ && git remote add -f -t $(master) -m $(master) origin $(origin)
+ cd $@ && git merge origin
+
+# WARNING: this may wipe unrelated files too!
+ultraclean:
+ rm -rf $(underlays)
+ rm -rf $(dir $(underlays_l10n))