aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: 8a69b7ef2c464daf9f0a0f374d45ea02c94f29ac (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. MKDOCS_PREP ?= bin/mkdocs-prep.pl
  4. all: doc
  5. doc: docs $(patsubst %,docs/%,$(subst -,/,$(notdir $(wildcard source/*))))
  6. mkdocs build
  7. check:
  8. checklink site/index.html
  9. # TODO: drop symlink removal when 2020-06-19 is well in the past
  10. docs:
  11. mkdir -p docs
  12. find docs -type l -delete
  13. $(MKDOCS_PREP) README.md docs/index.md
  14. $(MKDOCS_PREP) SETUP.md docs/setup.md
  15. docs/%: source
  16. mkdir -p docs/$*
  17. $(MKDOCS_PREP) source/$(subst /,-,$*)/README.md docs/$*/index.md
  18. $(if $(wildcard source/$(subst /,-,$*)/USE.md),\
  19. $(MKDOCS_PREP) source/$(subst /,-,$*)/USE.md docs/$*/use.md)
  20. $(if $(wildcard source/$(subst /,-,$*)/ADMIN.md),\
  21. $(MKDOCS_PREP) source/$(subst /,-,$*)/ADMIN.md docs/$*/admin.md)
  22. $(if $(wildcard source/$(subst /,-,$*)/SETUP.md),\
  23. $(MKDOCS_PREP) source/$(subst /,-,$*)/SETUP.md docs/$*/setup.md)
  24. $(if $(wildcard source/$(subst /,-,$*)/DEVELOP.md),\
  25. $(MKDOCS_PREP) source/$(subst /,-,$*)/DEVELOP.md docs/$*/devel.md)
  26. init:
  27. mr update
  28. clean:
  29. rm -rf site
  30. rm -rf docs
  31. distclean: clean
  32. rm -rf source
  33. rm -f site.mk
  34. .PHONY: all doc check clean distclean