aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: 40d4bce19257f243f0dd06612e1649749a06b6e3 (plain)
  1. # Depends: myrepos git mkdocs linkchecker
  2. all: doc
  3. doc: docs $(patsubst %,docs/%,$(subst -,/,$(notdir $(wildcard source/*))))
  4. mkdocs build --strict
  5. linkchecker site/index.html
  6. docs:
  7. mkdir -p docs
  8. ln -sf ../README.md docs/index.md
  9. # ln -sf ../USE.md docs/use.md
  10. # ln -sf ../ADMIN.md docs/admin.md
  11. docs/%: source
  12. mkdir -p docs/$*
  13. ln -sf $(shell realpath --relative-to=$@ source/$(subst /,-,$*)/README.md) docs/$*/index.md
  14. $(if $(wildcard source/$(subst /,-,$*)/USE.md),\
  15. ln -sf $(shell realpath --relative-to=$@ source/$(subst /,-,$*)/USE.md) docs/$*/use.md)
  16. $(if $(wildcard source/$(subst /,-,$*)/ADMIN.md),\
  17. ln -sf $(shell realpath --relative-to=$@ source/$(subst /,-,$*)/ADMIN.md) docs/$*/admin.md)
  18. init:
  19. mr update
  20. clean:
  21. rm -rf site
  22. rm -rf docs
  23. distclean: clean
  24. rm -rf source
  25. .PHONY: all doc clean distclean