Skip to contentSkip to conversation

tools: kbuild: use interpreters to invoke scripts

RFC PATCH New Ujjwal Kumar 1 participant 1 message Oct 1, 2020

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 tools: kbuild: use interpreters to invoke scripts

We cannot rely on execute bits to be set on files in the repository. The build script should use the explicit interpreter when invoking any script from the repository.

---
 tools/bootconfig/Makefile                        |  2 +-
 tools/bpf/Makefile.helpers                       |  2 +-
 tools/lib/bpf/Makefile                           |  2 +-
 tools/perf/Makefile.perf                         |  2 +-
 tools/power/cpupower/Makefile                    |  2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)
tools/bootconfig/Makefile +1 -1
index da5975775337..b6aee03a6ca9 100644
@@ -21,7 +21,7 @@ $(OUTPUT)bootconfig: main.c $(LIBSRC)
 	$(CC) $(filter %.c,$^) $(CFLAGS) -o $@
 
 test: $(ALL_PROGRAMS) test-bootconfig.sh
-	./test-bootconfig.sh $(OUTPUT)
+	$(CONFIG_SHELL) ./test-bootconfig.sh $(OUTPUT)
 
 install: $(ALL_PROGRAMS)
 	install $(OUTPUT)bootconfig $(DESTDIR)$(bindir)
tools/bpf/Makefile.helpers +1 -1
index 854d084026dd..6f2b042ff719 100644
@@ -35,7 +35,7 @@ man7: $(DOC_MAN7)
 RST2MAN_DEP := $(shell command -v rst2man 2>/dev/null)
 
 $(OUTPUT)$(HELPERS_RST): $(UP2DIR)../../include/uapi/linux/bpf.h
-	$(QUIET_GEN)$(UP2DIR)../../scripts/bpf_helpers_doc.py --filename $< > $@
+	$(QUIET_GEN)$(PYTHON3) $(UP2DIR)../../scripts/bpf_helpers_doc.py --filename $< > $@
 
 $(OUTPUT)%.7: $(OUTPUT)%.rst
 ifndef RST2MAN_DEP
tools/lib/bpf/Makefile +1 -1
index f43249696d9f..8a3f7399568f 100644
@@ -179,7 +179,7 @@ $(BPF_IN_STATIC): force elfdep zdep bpfdep $(BPF_HELPER_DEFS)
 	$(Q)$(MAKE) $(build)=libbpf OUTPUT=$(STATIC_OBJDIR)
 
 $(BPF_HELPER_DEFS): $(srctree)/tools/include/uapi/linux/bpf.h
-	$(QUIET_GEN)$(srctree)/scripts/bpf_helpers_doc.py --header \
+	$(QUIET_GEN)$(PYTHON3) $(srctree)/scripts/bpf_helpers_doc.py --header \
 		--file $(srctree)/tools/include/uapi/linux/bpf.h > $(BPF_HELPER_DEFS)
 
 $(OUTPUT)libbpf.so: $(OUTPUT)libbpf.so.$(LIBBPF_VERSION)
tools/perf/Makefile.perf +1 -1
index 6031167939ae..42f797e541d0 100644
@@ -229,7 +229,7 @@ goals := $(filter-out all sub-make, $(MAKECMDGOALS))
 $(goals) all: sub-make
 
 sub-make: fixdep
-	@./check-headers.sh
+	$(Q)$(SHELL) ./check-headers.sh
 	$(Q)$(MAKE) FIXDEP=1 -f Makefile.perf $(goals)
 
 else # force_fixdep
tools/power/cpupower/Makefile +1 -1
index c7bcddbd486d..b683e774f5e3 100644
@@ -51,7 +51,7 @@ DESTDIR ?=
 # Package-related definitions. Distributions can modify the version
 # and _should_ modify the PACKAGE_BUGREPORT definition
 
-VERSION:=			$(shell ./utils/version-gen.sh)
+VERSION:=			$($(CONFIG_SHELL) ./utils/version-gen.sh)
 LIB_MAJ=			0.0.1
 LIB_MIN=			0
 
Signature · 6 lines
2.26.2

_______________________________________________
Linux-kernel-mentees mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees