Skip to content

Commit 002621a

Browse files
jdelvarenathanchance
authored andcommitted
kbuild: Let kernel-doc.py use PYTHON3 override
It is possible to force a specific version of python to be used when building the kernel by passing PYTHON3= on the make command line. However kernel-doc.py is currently called with python3 hard-coded and thus ignores this setting. Use $(PYTHON3) to run $(KERNELDOC) so that the desired version of python is used. Signed-off-by: Jean Delvare <jdelvare@suse.de> Reviewed-by: Nicolas Schier <nsc@kernel.org> Reviewed-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Link: https://patch.msgid.link/20251107192933.2bfe9e57@endymion Signed-off-by: Nathan Chancellor <nathan@kernel.org>
1 parent 9818af1 commit 002621a

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

drivers/gpu/drm/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ always-$(CONFIG_DRM_HEADER_TEST) += \
245245
quiet_cmd_hdrtest = HDRTEST $(patsubst %.hdrtest,%.h,$@)
246246
cmd_hdrtest = \
247247
$(CC) $(c_flags) -fsyntax-only -x c /dev/null -include $< -include $<; \
248-
PYTHONDONTWRITEBYTECODE=1 $(KERNELDOC) -none $(if $(CONFIG_WERROR)$(CONFIG_DRM_WERROR),-Werror) $<; \
248+
PYTHONDONTWRITEBYTECODE=1 $(PYTHON3) $(KERNELDOC) -none $(if $(CONFIG_WERROR)$(CONFIG_DRM_WERROR),-Werror) $<; \
249249
touch $@
250250

251251
$(obj)/%.hdrtest: $(src)/%.h FORCE

drivers/gpu/drm/i915/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ obj-$(CONFIG_DRM_I915_GVT_KVMGT) += kvmgt.o
413413
#
414414
# Enable locally for CONFIG_DRM_I915_WERROR=y. See also scripts/Makefile.build
415415
ifdef CONFIG_DRM_I915_WERROR
416-
cmd_checkdoc = PYTHONDONTWRITEBYTECODE=1 $(KERNELDOC) -none -Werror $<
416+
cmd_checkdoc = PYTHONDONTWRITEBYTECODE=1 $(PYTHON3) $(KERNELDOC) -none -Werror $<
417417
endif
418418

419419
# header test

include/drm/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ always-$(CONFIG_DRM_HEADER_TEST) += \
1111
quiet_cmd_hdrtest = HDRTEST $(patsubst %.hdrtest,%.h,$@)
1212
cmd_hdrtest = \
1313
$(CC) $(c_flags) -fsyntax-only -x c /dev/null -include $< -include $<; \
14-
PYTHONDONTWRITEBYTECODE=1 $(KERNELDOC) -none $(if $(CONFIG_WERROR)$(CONFIG_DRM_WERROR),-Werror) $<; \
14+
PYTHONDONTWRITEBYTECODE=1 $(PYTHON3) $(KERNELDOC) -none $(if $(CONFIG_WERROR)$(CONFIG_DRM_WERROR),-Werror) $<; \
1515
touch $@
1616

1717
$(obj)/%.hdrtest: $(src)/%.h FORCE

scripts/Makefile.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ else ifeq ($(KBUILD_CHECKSRC),2)
167167
endif
168168

169169
ifneq ($(KBUILD_EXTRA_WARN),)
170-
cmd_checkdoc = PYTHONDONTWRITEBYTECODE=1 $(KERNELDOC) -none $(KDOCFLAGS) \
170+
cmd_checkdoc = PYTHONDONTWRITEBYTECODE=1 $(PYTHON3) $(KERNELDOC) -none $(KDOCFLAGS) \
171171
$(if $(findstring 2, $(KBUILD_EXTRA_WARN)), -Wall) \
172172
$<
173173
endif

0 commit comments

Comments
 (0)