tools: gpio: fix building from the top level with O=
Subsystems (4)
Sasha Levin
maintainerPATCH 1/1 tools: gpio: fix building from the top level with O=
"make O=<dir> tools/gpio" fails:
Makefile:27: /tools/build/Makefile.include: No such file or directory
tools/Makefile clears srctree, and the gpio Makefile only works it out again when building_out_of_srctree is not set, which the top-level Makefile sets for O= builds.
Also work out srctree when it is empty, as tools/bpf/Makefile does since commit a89b2cbf71d64 ("tools, bpf: Fix build for 'make -s tools/bpf O=<dir>'").
--- tools/gpio/Makefile | 6 ++++++ 1 file changed, 6 insertions(+)
tools/gpio/Makefile +6 -0
@@ -7,7 +7,13 @@ bindir ?= /usr/bin # isn't set and when invoked from selftests build, where srctree # is set to ".". building_out_of_srctree is undefined for in srctree # builds +ifeq ($(srctree),) +update_srctree := 1 +endif ifndef building_out_of_srctree +update_srctree := 1 +endif +ifeq ($(update_srctree),1) srctree := $(patsubst %/,%,$(dir $(CURDIR))) srctree := $(patsubst %/,%,$(dir $(srctree))) endif
Signature · 1 line
2.53.0
Bartosz Golaszewski
AppliedQuoted 9 lines · Sasha Levin
"make O=<dir>
tools/gpio" fails:Makefile:27: /tools/build/Makefile.include: No such file or directory
tools/Makefileclears srctree, and the gpioMakefileonly works it out again whenbuilding_out_of_srctreeis not set, which the top-levelMakefilesets for O= builds.[...]
Applied, thanks!
[1/1] tools: gpio: fix building from the top level with O=
https://git.kernel.org/brgl/c/52336337f1a01ad803c7f3ddb23f40222e9ad58d
Best regards,
Signature · 1 line
Bartosz Golaszewski <[email protected]>