aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: 60b6bcad85b98c1f468c163213c4d5b07db585a1 (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. mailhost ?= mail.$(domain)
  9. matrixhost ?= matrix.$(domain)
  10. organisation ?= Example orga
  11. contact_sysadmins ?= contact sysadmins
  12. VARIABLES = domain eventhost shellhost githost gitshellhost mailhost matrixhost organisation contact_sysadmins
  13. MKDOCS_PREP ?= bin/mkdocs-prep.pl
  14. all: doc
  15. doc: docs $(patsubst %,docs/%,$(subst -,/,$(notdir $(wildcard source/*))))
  16. mkdocs build
  17. check:
  18. checklink site/index.html
  19. # TODO: drop symlink removal when 2020-06-19 is well in the past
  20. docs:
  21. mkdir -p docs
  22. find docs -type l -delete
  23. $(MKDOCS_PREP) README.md docs/index.md
  24. $(MKDOCS_PREP) SETUP.md docs/setup.md
  25. docs/%: source
  26. mkdir -p docs/$*
  27. $(MKDOCS_PREP) source/$(subst /,-,$*)/README.md docs/$*/index.md
  28. $(if $(wildcard source/$(subst /,-,$*)/USE.md),\
  29. $(MKDOCS_PREP) source/$(subst /,-,$*)/USE.md docs/$*/use.md)
  30. $(if $(wildcard source/$(subst /,-,$*)/ADMIN.md),\
  31. $(MKDOCS_PREP) source/$(subst /,-,$*)/ADMIN.md docs/$*/admin.md)
  32. $(if $(wildcard source/$(subst /,-,$*)/SETUP.md),\
  33. $(MKDOCS_PREP) source/$(subst /,-,$*)/SETUP.md docs/$*/setup.md)
  34. $(if $(wildcard source/$(subst /,-,$*)/DEVELOP.md),\
  35. $(MKDOCS_PREP) source/$(subst /,-,$*)/DEVELOP.md docs/$*/devel.md)
  36. init:
  37. mr update
  38. $(if $(wildcard site.mk),,$(foreach v,$(VARIABLES),echo $v = $($v) >> site.mk;))
  39. clean:
  40. rm -rf site
  41. rm -rf docs
  42. distclean: clean
  43. rm -rf source
  44. rm -f site.mk
  45. .PHONY: all doc check clean distclean