summaryrefslogtreecommitdiff
path: root/Makefile
blob: be53be37eada87aff9578323a6878b05c7bafe05 (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. always-make = $(filter -B,$(MAKEFLAGS))
  9. avoid-broken-git = $(shell cd content && git symbolic-ref -q HEAD > /dev/null || echo --no-rcs)
  10. all: build
  11. init: submodules content
  12. -$(MAKE) -C shared/themes -B
  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. $(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')
  21. content: submodules
  22. mkdir -p '$@'
  23. [ -e '$@/index.mdwn' ] || printf '# Hello world!\n\nHello world!\n' > '$@/index.mdwn'
  24. build: $(cssfiles)
  25. find config -name *.setup -exec ikiwiki --setup '{}' $(avoid-broken-git) $(if $(always-make),--rebuild) ';'
  26. .PHONY: all build submodules content