From: Akira Yokosawa Date: Thu, 1 May 2025 08:21:07 +0000 (+0900) Subject: docs: Makefile: Inherit PYTHONPYCACHEPREFIX setting as env variable X-Git-Tag: v6.16-rc1~176^2~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a5b57bd9b1f9ff69327fa2e5bd272c8694e626fb;p=thirdparty%2Fkernel%2Flinux.git docs: Makefile: Inherit PYTHONPYCACHEPREFIX setting as env variable Commit 6c2f0b28d76e ("docs: Makefile: store __pycache__ at the output directory") assigns a new path to PYTHONPYCACHEPREFIX for building kernel documentation. However, it is not necessarily optimal for everyone. If you find PYTHONPYCACHEPREFIX is already set, it strongly suggests that the developer has selected the setting as best suited for one's own workflow. Use "?=" in the assignment to PYTHONPYCACHEPREFIX so that the path of $(abspath $(BUILDDIR)/__pycache__) works only as a safeguard. Signed-off-by: Akira Yokosawa Cc: Mauro Carvalho Chehab Signed-off-by: Jonathan Corbet Message-ID: <0253ce98-960c-4498-8ace-a4354e3ebc26@gmail.com> --- diff --git a/Documentation/Makefile b/Documentation/Makefile index 59e95ebae786c..d30d66ddf1ada 100644 --- a/Documentation/Makefile +++ b/Documentation/Makefile @@ -82,9 +82,11 @@ loop_cmd = $(echo-cmd) $(cmd_$(1)) || exit; # $5 reST source folder relative to $(src), # e.g. "userspace-api/media" for the linux-tv book-set at ./Documentation/userspace-api/media +PYTHONPYCACHEPREFIX ?= $(abspath $(BUILDDIR)/__pycache__) + quiet_cmd_sphinx = SPHINX $@ --> file://$(abspath $(BUILDDIR)/$3/$4) cmd_sphinx = $(MAKE) BUILDDIR=$(abspath $(BUILDDIR)) $(build)=Documentation/userspace-api/media $2 && \ - PYTHONPYCACHEPREFIX=$(abspath $(BUILDDIR)/__pycache__) \ + PYTHONPYCACHEPREFIX="$(PYTHONPYCACHEPREFIX)" \ BUILDDIR=$(abspath $(BUILDDIR)) SPHINX_CONF=$(abspath $(src)/$5/$(SPHINX_CONF)) \ $(PYTHON3) $(srctree)/scripts/jobserver-exec \ $(CONFIG_SHELL) $(srctree)/Documentation/sphinx/parallel-wrapper.sh \