summaryrefslogtreecommitdiff
path: root/Makefile
blob: 1021ab38a36607a3a5eb5c8b9d35a11a4e2b54e2 (plain)
  1. sources ikiwiki
  2. origin_ikiwiki http://source.jones.dk/ikiwiki_$(underlay).git
  3. underlays_ikiwiki basewiki smiley templates
  4. master_ikiwiki master$(locale:%=-$(locale))
  5. locales_ikiwiki da
  6. #dummies = content_dummy
  7. underlays_l10n = $(foreach source, $(sources), $(foreach locale, $(locales_$(source)), $(patsubst %,%_l10n/$(locale),$(underlays_$(source)))))
  8. underlays = $(foreach source, $(sources), $(underlays_$(source))) $(underlays_l10n)
  9. source_of_underlay = $(firstword $(foreach source, $(sources), $(if $(filter $(underlay),$(underlays_$(source))),$(source))))
  10. origin = $(origin_$(source_of_underlay))
  11. master = $(master_$(source_of_underlay))
  12. all: $(underlays) $(dummies)
  13. $(underlays): locale=$(if $(filter l10n/,$(lastword $(subst _, ,$(dir $@)))),$(notdir $@))
  14. $(underlays): underlay=$(@:%_l10n/$(locale)=%)
  15. $(underlays):
  16.     mkdir -$@
  17.     @if [ -"$@/.git" ]; then \
  18.         cd $&& \
  19.         git pull\
  20.     else \
  21.         cd $&& \
  22.         git init && \
  23.         git remote add --$(master) -$(masterorigin $(origin) && \
  24.         git merge origin\
  25.     fi
  26. $(dummies):
  27.     mkdir -$@
  28. install:
  29.     $(error FIXMEyou need to adjust ikiwiki.setup first!)
  30. #   ikiwiki --setup ikiwiki.setup --rebuild
  31. # WARNING: this may wipe unrelated files too!
  32. ultraclean:
  33.     rm -rf $(underlays)
  34.     rm -rf $(dir $(underlays_l10n))
  35.     rm -rf $(dummies)
  36. .PHONY: $(underlays)