summaryrefslogtreecommitdiff
path: root/Makefile
blob: 31195884a8e250ae9b185da5493c2904166af693 (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. @if [ -d "$@/.git" ]; then \
  18. cd $@ && \
  19. git pull; \
  20. else \
  21. cd $@ && \
  22. git init && \
  23. git remote add -f -t $(master) -m $(master) origin $(origin) && \
  24. git merge origin && \
  25. git config remote.origin.push +refs/heads/master:refs/heads/$(master); \
  26. fi
  27. $(dummies):
  28. mkdir -p $@
  29. install:
  30. $(error FIXME: you need to adjust ikiwiki.setup first!)
  31. # ikiwiki --setup ikiwiki.setup --rebuild
  32. # WARNING: this may wipe unrelated files too!
  33. ultraclean:
  34. rm -rf $(underlays)
  35. rm -rf $(dir $(underlays_l10n))
  36. rm -rf $(dummies)
  37. .PHONY: $(underlays)