Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [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. |
| 6 | SPHINXOPTS ?= |
| 7 | SPHINXBUILD ?= sphinx-build |
| 8 | SOURCEDIR = . |
| 9 | BUILDDIR = _build |
| 10 | DESTDIR = final |
| 11 | |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 12 | # Put it first so that "make" without argument is like "make help". |
| 13 | help: |
| 14 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) |
| 15 | |
| 16 | .PHONY: help Makefile.sphinx clean publish |
| 17 | |
| 18 | publish: Makefile.sphinx html singlehtml |
| 19 | rm -rf $(BUILDDIR)/$(DESTDIR)/ |
| 20 | mkdir -p $(BUILDDIR)/$(DESTDIR)/ |
| 21 | cp -r $(BUILDDIR)/html/* $(BUILDDIR)/$(DESTDIR)/ |
| 22 | cp $(BUILDDIR)/singlehtml/index.html $(BUILDDIR)/$(DESTDIR)/singleindex.html |
| 23 | sed -i -e 's@index.html#@singleindex.html#@g' $(BUILDDIR)/$(DESTDIR)/singleindex.html |
| 24 | |
| 25 | clean: |
| 26 | @rm -rf $(BUILDDIR) |
| 27 | |
| 28 | # Catch-all target: route all unknown targets to Sphinx using the new |
| 29 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). |
| 30 | %: Makefile.sphinx |
| 31 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) |