Skip to content

Commit a5b57bd

Browse files
akiyksJonathan Corbet
authored andcommitted
docs: Makefile: Inherit PYTHONPYCACHEPREFIX setting as env variable
Commit 6c2f0b2 ("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 <[email protected]> Cc: Mauro Carvalho Chehab <[email protected]> Signed-off-by: Jonathan Corbet <[email protected]> Message-ID: <[email protected]>
1 parent 40e71e3 commit a5b57bd

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Documentation/Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,11 @@ loop_cmd = $(echo-cmd) $(cmd_$(1)) || exit;
8282
# $5 reST source folder relative to $(src),
8383
# e.g. "userspace-api/media" for the linux-tv book-set at ./Documentation/userspace-api/media
8484

85+
PYTHONPYCACHEPREFIX ?= $(abspath $(BUILDDIR)/__pycache__)
86+
8587
quiet_cmd_sphinx = SPHINX $@ --> file://$(abspath $(BUILDDIR)/$3/$4)
8688
cmd_sphinx = $(MAKE) BUILDDIR=$(abspath $(BUILDDIR)) $(build)=Documentation/userspace-api/media $2 && \
87-
PYTHONPYCACHEPREFIX=$(abspath $(BUILDDIR)/__pycache__) \
89+
PYTHONPYCACHEPREFIX="$(PYTHONPYCACHEPREFIX)" \
8890
BUILDDIR=$(abspath $(BUILDDIR)) SPHINX_CONF=$(abspath $(src)/$5/$(SPHINX_CONF)) \
8991
$(PYTHON3) $(srctree)/scripts/jobserver-exec \
9092
$(CONFIG_SHELL) $(srctree)/Documentation/sphinx/parallel-wrapper.sh \

0 commit comments

Comments
 (0)