Skip to content

Commit 2bd524e

Browse files
authored
Simplify doc/Makefile with sphinx-build make-mode (#3761)
1 parent 753a06e commit 2bd524e

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

doc/Makefile

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
# Makefile for Sphinx documentation
22

33
# You can set these variables from the command line.
4-
SPHINXOPTS = -j auto
5-
SPHINXBUILD = sphinx-build
4+
SPHINXOPTS ?= -j auto
5+
SPHINXBUILD ?= sphinx-build
66
SPHINXAUTOGEN = sphinx-autogen
7+
SOURCEDIR = .
78
BUILDDIR = _build
89

9-
# Internal variables.
10-
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(SPHINXOPTS) .
11-
1210
.PHONY: help all api html server clean
1311

1412
help:
@@ -28,20 +26,20 @@ api:
2826
@echo
2927
$(SPHINXAUTOGEN) -i -t _templates -o api/generated api/*.rst
3028

31-
html: api
29+
html latex: api
3230
@echo
33-
@echo "Building HTML files."
31+
@echo "Building "$@" files."
3432
@echo
3533
# Set PYGMT_USE_EXTERNAL_DISPLAY to "false" to disable external display
36-
PYGMT_USE_EXTERNAL_DISPLAY="false" $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
34+
PYGMT_USE_EXTERNAL_DISPLAY="false" $(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS)
3735
@echo
38-
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
36+
@echo "Build finished. The files are in $(BUILDDIR)/$@."
3937

4038
html-noplot: api
4139
@echo
4240
@echo "Building HTML files without example plots."
4341
@echo
44-
$(SPHINXBUILD) -D plot_gallery=0 -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
42+
$(SPHINXBUILD) -D plot_gallery=0 -M html $(SPHINXOPTS) "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS)
4543
@echo
4644
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
4745

0 commit comments

Comments
 (0)