]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
tools/docs: sphinx-build-wrapper: add a wrapper for sphinx-build
authorMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Thu, 18 Sep 2025 11:54:45 +0000 (13:54 +0200)
committerJonathan Corbet <corbet@lwn.net>
Thu, 18 Sep 2025 17:18:36 +0000 (11:18 -0600)
commit819667bc3ccdbb2a037fef5881d9e815b2f5f5b1
tree6f54e7c2de5b53a85f82ef7579465938be3a47eb
parentadf9dc2592aad3e66b09cb412e60337477bafb0d
tools/docs: sphinx-build-wrapper: add a wrapper for sphinx-build

There are too much magic inside docs Makefile to properly run
sphinx-build. Create an ancillary script that contains all
kernel-related sphinx-build call logic currently at Makefile.

Such script is designed to work both as an standalone command
and as part of a Makefile. As such, it properly handles POSIX
jobserver used by GNU make.

On a side note, there was a line number increase due to the
conversion (ignoring comments) is:

 Documentation/Makefile          |  131 +++----------
 tools/docs/sphinx-build-wrapper |  293 +++++++++++++++++++++++++++++++
 2 files changed, 323 insertions(+), 101 deletions(-)

Comments and descriptions adds:
 tools/docs/sphinx-build-wrapper | 261 +++++++++++++++++++++++++++++++-

So, about half of the script are comments/descriptions.

This is because some things are more verbosed on Python and because
it requires reading env vars from Makefile. Besides it, this script
has some extra features that don't exist at the Makefile:

- It can be called directly from command line;
- It properly return PDF build errors.

When running the script alone, it will only take handle sphinx-build
targets. On other words, it won't runn make rustdoc after building
htmlfiles, nor it will run the extra check scripts.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Message-ID: <80ae57b01fcfb1d338d93b8f8e26e57b69b5f16b.1758196090.git.mchehab+huawei@kernel.org>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Documentation/Makefile
tools/docs/sphinx-build-wrapper [new file with mode: 0755]