summaryrefslogtreecommitdiff
path: root/Makefile
blob: cc0e7c21c5839827511efafc2007c41d4c5a7cbc (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. underlays_l10n = $(foreach source, $(sources), $(foreach locale, $(locales_$(source)), $(patsubst %,%_l10n/$(locale),$(underlays_$(source)))))
  7. underlays = $(foreach source, $(sources), $(underlays_$(source))) $(underlays_l10n)
  8. source_of_underlay = $(firstword $(foreach source, $(sources), $(if $(filter $(underlay),$(underlays_$(source))),$(source))))
  9. origin = $(origin_$(source_of_underlay))
  10. master = $(master_$(source_of_underlay))
  11. all: $(underlays)
  12. $(underlays): locale=$(if $(filter l10n/,$(lastword $(subst _, ,$(dir $@)))),$(notdir $@))
  13. $(underlays): underlay=$(@:%_l10n/$(locale)=%)
  14. $(underlays):
  15. mkdir -p $@
  16. cd $@ && git init
  17. cd $@ && git remote add -f -t $(master) -m $(master) origin $(origin)
  18. cd $@ && git merge origin
  19. # WARNING: this may wipe unrelated files too!
  20. ultraclean:
  21. rm -rf $(underlays)
  22. rm -rf $(dir $(underlays_l10n))