docs: Use make invocation's -j argument for parallelism
authorKees Cook <keescook@chromium.org>
Tue, 24 Sep 2019 23:29:58 +0000 (16:29 -0700)
committerJonathan Corbet <corbet@lwn.net>
Tue, 1 Oct 2019 12:24:27 +0000 (06:24 -0600)
commit29efbb24d992564db4bbb808597719934ed9ac9f
treef0e5cea4c2345d762d7da07c105e57f192fd4639
parent54ecb8f7028c5eb3d740bb82b0f1d90f2df63c5c
docs: Use make invocation's -j argument for parallelism

While sphinx 1.7 and later supports "-jauto" for parallelism, this
effectively ignores the "-j" flag used in the "make" invocation, which
may cause confusion for build systems. Instead, extract the available
parallelism from "make"'s job server (since it is not exposed in any
special variables) and use that for the "sphinx-build" run. Now things
work correctly for builds where -j is specified at the top-level:

make -j16 htmldocs

If -j is not specified, continue to fallback to "-jauto" if available.

Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Documentation/Makefile
scripts/jobserver-count [new file with mode: 0755]