Shannon Zhu | 2de0a93 | 2021-06-03 18:53:01 -0700 | [diff] [blame] | 1 | # 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 Zhu | 2de0a93 | 2021-06-03 18:53:01 -0700 | [diff] [blame] | 6 | SOURCEDIR = . |
Shannon Zhu | 0fc0eda | 2021-06-27 10:57:12 -0700 | [diff] [blame] | 7 | SOURCES = |
Shannon Zhu | 2de0a93 | 2021-06-03 18:53:01 -0700 | [diff] [blame] | 8 | BUILDDIR = _build |
Shannon Zhu | 0fc0eda | 2021-06-27 10:57:12 -0700 | [diff] [blame] | 9 | PYTHON = python3 |
| 10 | VENVDIR = ./venv |
| 11 | SPHINXBUILD = PATH=$(VENVDIR)/bin:$$PATH sphinx-build |
| 12 | |
| 13 | ALLSPHINXOPTS = -b $(BUILDER) -d build/doctrees $(SPHINXOPTS) . build/$(BUILDER) $(SOURCES) |
| 14 | |
| 15 | .PHONY: help clean build html text venv Makefile |
Shannon Zhu | 2de0a93 | 2021-06-03 18:53:01 -0700 | [diff] [blame] | 16 | |
| 17 | # Put it first so that "make" without argument is like "make help". |
| 18 | help: |
| 19 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) |
| 20 | |
Shannon Zhu | 0fc0eda | 2021-06-27 10:57:12 -0700 | [diff] [blame] | 21 | clean: |
| 22 | -rm -rf build/* $(VENVDIR)/* |
| 23 | |
| 24 | build: |
| 25 | -mkdir -p build |
| 26 | $(SPHINXBUILD) $(ALLSPHINXOPTS) |
| 27 | @echo |
| 28 | |
| 29 | html: BUILDER = html |
| 30 | html: build |
| 31 | @echo "Build finished. The HTML pages are in build/html." |
| 32 | |
| 33 | text: BUILDER = text |
| 34 | text: build |
| 35 | @echo "Build finished; the text files are in build/text." |
| 36 | |
| 37 | venv: |
| 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 Zhu | 2de0a93 | 2021-06-03 18:53:01 -0700 | [diff] [blame] | 42 | |
| 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) |