aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: f8ce4ef4badbfdb5a1a8878288a9bbef044466d0 (plain)
  1. # Depends: myrepos git mkdocs linkchecker
  2. all: doc
  3. doc: docs $(patsubst %,docs/%,$(subst -,/,$(notdir $(wildcard source/*))))
  4. mkdocs build
  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. $(if $(wildcard source/$(subst /,-,$*)/SETUP.md),\
  19. ln -sf $(shell realpath --relative-to=$@ source/$(subst /,-,$*)/SETUP.md) docs/$*/setup.md)
  20. init:
  21. mr update
  22. clean:
  23. rm -rf site
  24. rm -rf docs
  25. distclean: clean
  26. rm -rf source
  27. .PHONY: all doc clean distclean