chiark / gitweb /
docs: Wire build into our top-level Makefile
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 8 Apr 2021 18:12:11 +0000 (19:12 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 8 Apr 2021 19:34:21 +0000 (20:34 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Makefile
docs/Makefile [deleted file]
docs/dev.md

index a671eee5a75a8ef8de408bbe2755dca31dccc9a5..7d47638a4608e1f5715c2d333732410f459c9126 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -51,6 +51,8 @@ WASM_BINDGEN_OPTIONS =                                                \
 
 BUNDLE_SOURCES ?= bundle-rust-sources
 
+SPHINXBUILD   = sphinx-build
+
 ifndef INKSCAPE_EXTENSIONS
 INKSCAPE ?= inkscape
 INKSCAPE_EXTENSIONS := $(shell $(INKSCAPE) -x)
@@ -138,7 +140,7 @@ WASM := wasm32-unknown-unknown
 check: stamp/cargo.check at wdt
        @echo 'All tests passed.'
 
-doc: cargo-doc
+doc: cargo-doc sphinx-doc
 
 debug release:: %: stamp/cargo.% assets libraries extra-%
 
@@ -214,6 +216,13 @@ stamp/cargo.deploy-build: $(call rsrcs,.)
        $(CARGO) -T$(DEPLOY_ARCH) build $(call cr,$(DEPLOY_RELEASE)) -p otter -p otter-daemon
        $(stamp)
 
+#---------- sphnix ----------
+
+sphinx-doc: docs/html/index.html
+
+docs/build/html/index.html: docs/conf.py $(wildcard docs/*.md docs/*.rst)
+       $(SPHINXBUILD) -M html docs docs/build $(SPHINXOPTS)
+
 #---------- wasm ----------
 
 $(addprefix $(WASM_PACKED)/,$(WASM_ASSETS) $(WASM_OUTPUTS)): stamp/wasm-bindgen
diff --git a/docs/Makefile b/docs/Makefile
deleted file mode 100644 (file)
index 35e7246..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-# Minimal makefile for Sphinx documentation
-#
-
-# You can set these variables from the command line.
-SPHINXOPTS    =
-SPHINXBUILD   = sphinx-build
-SOURCEDIR     = .
-BUILDDIR      = build
-
-# Put it first so that "make" without argument is like "make help".
-help:
-       @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
-
-.PHONY: help Makefile
-
-# Catch-all target: route all unknown targets to Sphinx using the new
-# "make mode" option.  $(O) is meant as a shortcut for $(SPHINXOPTS).
-%: Makefile
-       $(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
-
index a8f823af57521b46bf38042670ab95b90c7cf83a..6f9974467464a2ff5bb23baec4caea9e8285e4bb 100644 (file)
@@ -22,7 +22,8 @@ Setup
      sudo apt install build-essential cpio git curl     \
                       pkg-config libssl-dev             \
                       node-typescript inkscape bubblewrap \
-                      netpbm imagemagick
+                      netpbm imagemagick \
+                      python3-sphinx python3-recommonmark
 ```
 
 2. Install Rust.  This is most easily done with [rustup](https://rustup.rs)):