summaryrefslogtreecommitdiff
path: root/Makefile
blob: b2072ebf6bd5822f847d437e6320911164a8f4bd (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. # WARNING: this may wipe unrelated files too!
  29. ultraclean:
  30.     rm -rf $(underlays)
  31.     rm -rf $(dir $(underlays_l10n))
  32.     rm -rf $(dummies)
  33. .PHONY: $(underlays)