aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: d358ec370d0ffe8a109228ddb383258f2a832636 (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. $(if $(wildcard source/$(subst /,-,$*)/DEVELOP.md),\
  21. ln -sf $(shell realpath --relative-to=$@ source/$(subst /,-,$*)/DEVELOP.md) docs/$*/devel.md)
  22. init:
  23. mr update
  24. clean:
  25. rm -rf site
  26. rm -rf docs
  27. distclean: clean
  28. rm -rf source
  29. .PHONY: all doc clean distclean