Skip to content

Commit 4a6a6f5

Browse files
shuahkhbrgl
authored andcommitted
tools: gpio: Use !building_out_of_srctree to determine srctree
make TARGETS=gpio kselftest fails with: Makefile:23: tools/build/Makefile.include: No such file or directory When the gpio tool make is invoked from tools Makefile, srctree is cleared and the current logic check for srctree equals to empty string to determine srctree location from CURDIR. When the build in invoked from selftests/gpio Makefile, the srctree is set to "." and the same logic used for srctree equals to empty is needed to determine srctree. Check building_out_of_srctree undefined as the condition for both cases to fix "make TARGETS=gpio kselftest" build failure. Cc: [email protected] Signed-off-by: Shuah Khan <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
1 parent 7d194c2 commit 4a6a6f5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tools/gpio/Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@ include ../scripts/Makefile.include
33

44
bindir ?= /usr/bin
55

6-
ifeq ($(srctree),)
6+
# This will work when gpio is built in tools env. where srctree
7+
# isn't set and when invoked from selftests build, where srctree
8+
# is set to ".". building_out_of_srctree is undefined for in srctree
9+
# builds
10+
ifndef building_out_of_srctree
711
srctree := $(patsubst %/,%,$(dir $(CURDIR)))
812
srctree := $(patsubst %/,%,$(dir $(srctree)))
913
endif

0 commit comments

Comments
 (0)