aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: cd21f72dddcc9e5c9ae1e9a99dce877acc6d64ac (plain)
  1. # Depends: myrepos git mkdocs 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. linkchecker site/index.html
  20. docs:
  21. mkdir -p docs
  22. ln -sf ../README.md docs/index.md
  23. # ln -sf ../USE.md docs/use.md
  24. # ln -sf ../ADMIN.md docs/admin.md
  25. docs/%: source
  26. mkdir -p docs/$*
  27. $(MUSTACHE) < source/$(subst /,-,$*)/README.md > docs/$*/index.md
  28. $(if $(wildcard source/$(subst /,-,$*)/USE.md),\
  29. $(MUSTACHE) < source/$(subst /,-,$*)/USE.md > docs/$*/use.md)
  30. $(if $(wildcard source/$(subst /,-,$*)/ADMIN.md),\
  31. $(MUSTACHE) < source/$(subst /,-,$*)/ADMIN.md > docs/$*/admin.md)
  32. $(if $(wildcard source/$(subst /,-,$*)/SETUP.md),\
  33. $(MUSTACHE) < source/$(subst /,-,$*)/SETUP.md > docs/$*/setup.md)
  34. $(if $(wildcard source/$(subst /,-,$*)/DEVELOP.md),\
  35. $(MUSTACHE) < source/$(subst /,-,$*)/DEVELOP.md > docs/$*/devel.md)
  36. init:
  37. mr update
  38. clean:
  39. rm -rf site
  40. rm -rf docs
  41. distclean: clean
  42. rm -rf source
  43. .PHONY: all doc clean distclean