blob: 4f7c95a881c59a225629b992afe1686a214399e6 [file] [log] [blame]
Shannon Zhu2de0a932021-06-03 18:53:01 -07001# Minimal makefile for Sphinx documentation
2#
3
4# You can set these variables from the command line, and also
5# from the environment for the first two.
Shannon Zhu2de0a932021-06-03 18:53:01 -07006SOURCEDIR = .
Shannon Zhu0fc0eda2021-06-27 10:57:12 -07007SOURCES =
Shannon Zhu2de0a932021-06-03 18:53:01 -07008BUILDDIR = _build
Shannon Zhu0fc0eda2021-06-27 10:57:12 -07009PYTHON = python3
10VENVDIR = ./venv
11SPHINXBUILD = PATH=$(VENVDIR)/bin:$$PATH sphinx-build
12
13ALLSPHINXOPTS = -b $(BUILDER) -d build/doctrees $(SPHINXOPTS) . build/$(BUILDER) $(SOURCES)
14
15.PHONY: help clean build html text venv Makefile
Shannon Zhu2de0a932021-06-03 18:53:01 -070016
17# Put it first so that "make" without argument is like "make help".
18help:
19 @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
20
Shannon Zhu0fc0eda2021-06-27 10:57:12 -070021clean:
22 -rm -rf build/* $(VENVDIR)/*
23
24build:
25 -mkdir -p build
26 $(SPHINXBUILD) $(ALLSPHINXOPTS)
27 @echo
28
29html: BUILDER = html
30html: build
31 @echo "Build finished. The HTML pages are in build/html."
32
33text: BUILDER = text
34text: build
35 @echo "Build finished; the text files are in build/text."
36
37venv:
38 $(PYTHON) -m venv $(VENVDIR)
39 $(VENVDIR)/bin/python3 -m pip install -U pip setuptools
40 $(VENVDIR)/bin/python3 -m pip install -r requirements.txt
41 @echo "The venv has been created in the $(VENVDIR) directory"
Shannon Zhu2de0a932021-06-03 18:53:01 -070042
43# Catch-all target: route all unknown targets to Sphinx using the new
44# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
45%: Makefile
46 @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)