summaryrefslogtreecommitdiff
path: root/Makefile
blob: cb3a012d7840e8b3c6cefff45b894f21bc3eb148 (plain)
  1. IKIWIKI_OPTIONS ?= \
  2. --set srcdir='$(CURDIR)/content' \
  3. --set destdir='$(CURDIR)/build/html' \
  4. $(IKIWIKI_SHARED_OPTIONS) $(IKIWIKI_CONFIG_OPTIONS)
  5. cssprojects ?= $(wildcard shared/themes/goab styling)
  6. -include shared/include.mk
  7. -include config/include.mk
  8. -include shared/themes/include.mk
  9. always-make = $(filter -B,$(MAKEFLAGS))
  10. avoid-broken-git = $(shell cd content && git symbolic-ref -q HEAD > /dev/null || echo --no-rcs)
  11. all: build
  12. init: submodules content
  13. $(MAKE) -B config
  14. submodules:
  15. git submodule init
  16. git submodule update --init --recursive
  17. config: submodules
  18. mkdir -p '$@'
  19. [ -e '$@/'*.setup ] || ikiwiki $(IKIWIKI_OPTIONS) --dumpsetup '$@/ikiwiki.setup'
  20. content: submodules
  21. mkdir -p '$@'
  22. [ -e '$@/index.mdwn' ] || printf '# Hello world!\n\nHello world!\n' > '$@/index.mdwn'
  23. build: $(cssprojects)
  24. find config -name *.setup -exec ikiwiki --setup '{}' $(avoid-broken-git) $(if $(always-make),--rebuild) ';'
  25. .PHONY: all build submodules content