aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2018-11-24 18:00:49 +0100
committerJonas Smedegaard <dr@jones.dk>2018-11-24 18:00:49 +0100
commitee28654bb1095eeb08b8e404e7dca34e382c111c (patch)
tree8188e4f219cd5743f5dec73a9973c6f25972dfc3 /Makefile
Initial draft.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile33
1 files changed, 33 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..40d4bce
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,33 @@
+# Depends: myrepos git mkdocs linkchecker
+
+all: doc
+
+doc: docs $(patsubst %,docs/%,$(subst -,/,$(notdir $(wildcard source/*))))
+ mkdocs build --strict
+ 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)
+
+init:
+ mr update
+
+clean:
+ rm -rf site
+ rm -rf docs
+
+distclean: clean
+ rm -rf source
+
+.PHONY: all doc clean distclean