aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: 90ccc6061cddf661b39968c011c2a3662fd109d5 (plain)
  1. # Depends: myrepos git mkdocs w3c-linkchecker libconfig-tiny-perl libpath-tiny-perl libtext-hogan-perl libio-prompter-perl
  2. -include site.mk
  3. domain ?= example.org
  4. eventhost ?= event.$(domain)
  5. shellhost ?= shell.$(domain)
  6. githost ?= source.$(domain)
  7. gitshellhost ?= $(shellhost)
  8. matrixhost ?= matrix.$(domain)
  9. organisation ?= Example orga
  10. contact_sysadmins ?= contact sysadmins
  11. VARIABLES = domain eventhost shellhost githost gitshellhost matrixhost organisation contact_sysadmins
  12. MKDOCS_PREP ?= bin/mkdocs-prep.pl
  13. all: doc
  14. doc: docs $(patsubst %,docs/%,$(subst -,/,$(notdir $(wildcard source/*))))
  15. mkdocs build
  16. check:
  17. checklink site/index.html
  18. # TODO: drop symlink removal when 2020-06-19 is well in the past
  19. docs:
  20. mkdir -p docs
  21. find docs -type l -delete
  22. $(MKDOCS_PREP) README.md docs/index.md
  23. $(MKDOCS_PREP) SETUP.md docs/setup.md
  24. docs/%: source
  25. mkdir -p docs/$*
  26. $(MKDOCS_PREP) source/$(subst /,-,$*)/README.md docs/$*/index.md
  27. $(if $(wildcard source/$(subst /,-,$*)/USE.md),\
  28. $(MKDOCS_PREP) source/$(subst /,-,$*)/USE.md docs/$*/use.md)
  29. $(if $(wildcard source/$(subst /,-,$*)/ADMIN.md),\
  30. $(MKDOCS_PREP) source/$(subst /,-,$*)/ADMIN.md docs/$*/admin.md)
  31. $(if $(wildcard source/$(subst /,-,$*)/SETUP.md),\
  32. $(MKDOCS_PREP) source/$(subst /,-,$*)/SETUP.md docs/$*/setup.md)
  33. $(if $(wildcard source/$(subst /,-,$*)/DEVELOP.md),\
  34. $(MKDOCS_PREP) source/$(subst /,-,$*)/DEVELOP.md docs/$*/devel.md)
  35. init:
  36. mr update
  37. $(if $(wildcard site.mk),,$(foreach v,$(VARIABLES),echo $v = $($v) >> site.mk;))
  38. clean:
  39. rm -rf site
  40. rm -rf docs
  41. distclean: clean
  42. rm -rf source
  43. rm -f site.mk
  44. .PHONY: all doc check clean distclean