summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2007-10-21 22:45:39 +0200
committerJonas Smedegaard <dr@jones.dk>2007-10-21 22:45:39 +0200
commite972aef95fe67ad2d6ed5ed7a53f89434b505148 (patch)
tree6c995580f9afa04b8012011b1966851b113a76cb /Makefile
parented541277f5e71afb27be53a588543d1e80ec3873 (diff)
Add makefile with rules to clone and wipe GIT repositories of upstream and localized underlays. Ignore GIT repositories.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile29
1 files changed, 29 insertions, 0 deletions
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))