aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: 9e85e63ae03ea6dedfc32887b93fa3dff3f2b2ba (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. docs:
  22. mkdir -p docs
  23. ln -sf ../README.md docs/index.md
  24. # ln -sf ../USE.md docs/use.md
  25. # ln -sf ../ADMIN.md docs/admin.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