summaryrefslogtreecommitdiff
path: root/Documentation/Makefile
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab+samsung@kernel.org>2019-05-30 02:09:31 +0300
committerJonathan Corbet <corbet@lwn.net>2019-05-30 19:41:30 +0300
commitcf08508d21ffae5aea6c7dcb771ebd28612c6120 (patch)
treefde35b063afed8c3c43b501cfa236bcbb4599ea6 /Documentation/Makefile
parent0ca862e6f1c7e58e4eb9758fdb09255e6104d6a0 (diff)
downloadlinux-cf08508d21ffae5aea6c7dcb771ebd28612c6120.tar.xz
docs: by default, build docs a lot faster with Sphinx >= 1.7
Since Sphinx version 1.7, it is possible to use "-jauto" in order to speedup documentation builds. On older versions, while -j was already supported, one would need to set the number of threads manually. So, if SPHINXOPTS is not provided, add -jauto, in order to speed up the build. That makes it *a lot* times faster than without -j. If one really wants to slow things down, it can just use: make SPHINXOPTS=-j1 htmldocs Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> [ jc: fixed perl magic to determine sphinx version ] Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Diffstat (limited to 'Documentation/Makefile')
-rw-r--r--Documentation/Makefile2
1 files changed, 2 insertions, 0 deletions
diff --git a/Documentation/Makefile b/Documentation/Makefile
index 380e24053d6f..85d3cfafd77c 100644
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -28,6 +28,8 @@ ifeq ($(HAVE_SPHINX),0)
else # HAVE_SPHINX
+export SPHINXOPTS = $(shell perl -e 'open IN,"sphinx-build --version 2>&1 |"; while (<IN>) { if (m/([\d\.]+)/) { print "-jauto" if ($$1 >= "1.7") } ;} close IN')
+
# User-friendly check for pdflatex and latexmk
HAVE_PDFLATEX := $(shell if which $(PDFLATEX) >/dev/null 2>&1; then echo 1; else echo 0; fi)
HAVE_LATEXMK := $(shell if which latexmk >/dev/null 2>&1; then echo 1; else echo 0; fi)