# Depends: myrepos git mkdocs linkchecker all: doc doc: docs $(patsubst %,docs/%,$(subst -,/,$(notdir $(wildcard source/*)))) mkdocs build linkchecker site/index.html docs: mkdir -p docs ln -sf ../README.md docs/index.md # ln -sf ../USE.md docs/use.md # ln -sf ../ADMIN.md docs/admin.md docs/%: source mkdir -p docs/$* ln -sf $(shell realpath --relative-to=$@ source/$(subst /,-,$*)/README.md) docs/$*/index.md $(if $(wildcard source/$(subst /,-,$*)/USE.md),\ ln -sf $(shell realpath --relative-to=$@ source/$(subst /,-,$*)/USE.md) docs/$*/use.md) $(if $(wildcard source/$(subst /,-,$*)/ADMIN.md),\ ln -sf $(shell realpath --relative-to=$@ source/$(subst /,-,$*)/ADMIN.md) docs/$*/admin.md) $(if $(wildcard source/$(subst /,-,$*)/SETUP.md),\ ln -sf $(shell realpath --relative-to=$@ source/$(subst /,-,$*)/SETUP.md) docs/$*/setup.md) $(if $(wildcard source/$(subst /,-,$*)/DEVELOP.md),\ ln -sf $(shell realpath --relative-to=$@ source/$(subst /,-,$*)/DEVELOP.md) docs/$*/devel.md) init: mr update clean: rm -rf site rm -rf docs distclean: clean rm -rf source .PHONY: all doc clean distclean