Martin Roth | bfdb489 | 2022-10-28 22:25:02 -0600 | [diff] [blame] | 1 | ## SPDX-License-Identifier: GPL-2.0-only |
Nicholas Chin | 35599f9 | 2023-02-21 19:41:06 -0700 | [diff] [blame^] | 2 | # Minimal makefile for Sphinx documentation |
Jonathan Neuschäfer | 5e48c75 | 2018-04-19 16:23:56 +0200 | [diff] [blame] | 3 | # |
| 4 | |
Nicholas Chin | 35599f9 | 2023-02-21 19:41:06 -0700 | [diff] [blame^] | 5 | # You can set these variables from the command line, and also |
| 6 | # from the environment for the first two. |
| 7 | SPHINXOPTS ?= |
| 8 | SPHINXBUILD ?= sphinx-build |
| 9 | SPHINXAUTOBUILD = sphinx-autobuild |
| 10 | SOURCEDIR = . |
| 11 | BUILDDIR = _build |
Jonathan Neuschäfer | 5e48c75 | 2018-04-19 16:23:56 +0200 | [diff] [blame] | 12 | |
Nicholas Chin | 35599f9 | 2023-02-21 19:41:06 -0700 | [diff] [blame^] | 13 | # Put it first so that "make" without argument is like "make help". |
Jonathan Neuschäfer | 5e48c75 | 2018-04-19 16:23:56 +0200 | [diff] [blame] | 14 | help: |
Nicholas Chin | 35599f9 | 2023-02-21 19:41:06 -0700 | [diff] [blame^] | 15 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) |
Jonathan Neuschäfer | 5e48c75 | 2018-04-19 16:23:56 +0200 | [diff] [blame] | 16 | |
Nicholas Chin | 35599f9 | 2023-02-21 19:41:06 -0700 | [diff] [blame^] | 17 | .PHONY: help Makefile.sphinx |
Jonathan Neuschäfer | 5e48c75 | 2018-04-19 16:23:56 +0200 | [diff] [blame] | 18 | |
Tom Hiller | 651b11b | 2018-08-18 19:20:16 -0400 | [diff] [blame] | 19 | .PHONY: livehtml |
| 20 | livehtml: |
Jonathan Neuschäfer | 806ad19 | 2018-10-10 14:22:51 +0200 | [diff] [blame] | 21 | @echo "Starting sphinx-autobuild. The HTML pages are in $(BUILDDIR)." |
| 22 | @echo "Press Ctrl-C to stop." |
Tom Hiller | 651b11b | 2018-08-18 19:20:16 -0400 | [diff] [blame] | 23 | @echo |
Jonathan Neuschäfer | 806ad19 | 2018-10-10 14:22:51 +0200 | [diff] [blame] | 24 | $(SPHINXAUTOBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR) |
Tom Hiller | 651b11b | 2018-08-18 19:20:16 -0400 | [diff] [blame] | 25 | |
Nicholas Chin | 35599f9 | 2023-02-21 19:41:06 -0700 | [diff] [blame^] | 26 | # Catch-all target: route all unknown targets to Sphinx using the new |
| 27 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). |
| 28 | %: Makefile.sphinx |
| 29 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) |