summaryrefslogtreecommitdiff
path: root/doc/Makefile
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2014-01-19 16:23:23 +0100
committerGeorg Brandl <georg@python.org>2014-01-19 16:23:23 +0100
commitaaabdd9b8ba3757180e316098a478cf29d651aa7 (patch)
treeb9ee3bcbd2c3f12a7507ffcd0334ba4cd1384ee9 /doc/Makefile
parente0e0ddee1cccafa1398c4dd17a410890973eb42b (diff)
downloadsphinx-aaabdd9b8ba3757180e316098a478cf29d651aa7.tar.gz
Make mode: refactor using a class and add source dir to the makefile
Diffstat (limited to 'doc/Makefile')
-rw-r--r--doc/Makefile18
1 files changed, 6 insertions, 12 deletions
diff --git a/doc/Makefile b/doc/Makefile
index d799c365..8bc59724 100644
--- a/doc/Makefile
+++ b/doc/Makefile
@@ -5,20 +5,14 @@
SPHINXOPTS =
SPHINXBUILD = python ../sphinx-build.py
SPHINXPROJ = sphinx
+SOURCEDIR = .
BUILDDIR = _build
-# User-friendly check for sphinx-build
-ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
-$(error \
-The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx \
-installed, then set the SPHINXBUILD environment variable to point \
-to the full path of the '$(SPHINXBUILD)' executable. Alternatively you \
-can add the directory with the executable to your PATH. \
-If you don't have Sphinx installed, grab it from http://sphinx-doc.org/)
-endif
-
+# Has to be explicit, otherwise we don't get "make" without targets right.
help:
- @$(SPHINXBUILD) -M help "$(BUILDDIR)" $(SPHINXOPTS) $(O)
+ @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
+# Catch-all target: route all unknown targets to Sphinx using the new
+# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%:
- @$(SPHINXBUILD) -M $@ "$(BUILDDIR)" $(SPHINXOPTS) $(O)
+ $(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)