summaryrefslogtreecommitdiff
path: root/Makefile
blob: 9775eb147f7c37591433b9dec0dcfdca45a2c28a (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 -p $@
  17. cd $@ && git init
  18. cd $@ && git remote add -f -t $(master) -m $(master) origin $(origin)
  19. cd $@ && git merge origin
  20. $(dummies):
  21. mkdir -p $@
  22. # WARNING: this may wipe unrelated files too!
  23. ultraclean:
  24. rm -rf $(underlays)
  25. rm -rf $(dir $(underlays_l10n))
  26. rm -rf $(dummies)