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