aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: b20b3154fc1d0f0fc6da61422a5af83755c29de8 (plain)
  1. # Depends: myrepos git mkdocs w3c-linkchecker libtext-hogan-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. MUSTACHE = cat source/source/USE.md | perl -MText::Hogan::Compiler -0777 -nE '\
  12. my $$compiler = Text::Hogan::Compiler->new;\
  13. my $$template = $$compiler->compile($$_);\
  14. say $$template->render({ \
  15. domain => "$(domain)", eventhost => "$(eventhost)", shellhost => "$(shellhost)", githost => "$(githost)", gitshellhost => "$(gitshellhost)", \
  16. matrixhost => "$(matrixhost)", \
  17. organisation => "$(organisation)", contact_sysadmins => "$(contact_sysadmins)" })'
  18. all: doc
  19. doc: docs $(patsubst %,docs/%,$(subst -,/,$(notdir $(wildcard source/*))))
  20. mkdocs build
  21. check:
  22. checklink site/index.html
  23. # TODO: drop symlink removal when 2020-06-19 is well in the past
  24. docs:
  25. mkdir -p docs
  26. find docs -type l -delete
  27. $(MUSTACHE) < README.md > docs/index.md
  28. $(MUSTACHE) < SETUP.md > docs/setup.md
  29. docs/%: source
  30. mkdir -p docs/$*
  31. $(MUSTACHE) < source/$(subst /,-,$*)/README.md > docs/$*/index.md
  32. $(if $(wildcard source/$(subst /,-,$*)/USE.md),\
  33. $(MUSTACHE) < source/$(subst /,-,$*)/USE.md > docs/$*/use.md)
  34. $(if $(wildcard source/$(subst /,-,$*)/ADMIN.md),\
  35. $(MUSTACHE) < source/$(subst /,-,$*)/ADMIN.md > docs/$*/admin.md)
  36. $(if $(wildcard source/$(subst /,-,$*)/SETUP.md),\
  37. $(MUSTACHE) < source/$(subst /,-,$*)/SETUP.md > docs/$*/setup.md)
  38. $(if $(wildcard source/$(subst /,-,$*)/DEVELOP.md),\
  39. $(MUSTACHE) < source/$(subst /,-,$*)/DEVELOP.md > docs/$*/devel.md)
  40. init:
  41. mr update
  42. clean:
  43. rm -rf site
  44. rm -rf docs
  45. distclean: clean
  46. rm -rf source
  47. rm -f site.mk
  48. .PHONY: all doc check clean distclean