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