summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShuah Khan <skhan@linuxfoundation.org>2019-09-26 19:16:41 -0600
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-11-12 19:20:37 +0100
commit66d53cd683a82eabecdc1367bfa9a0abce5d1e13 (patch)
treea977a68c269ad8012921651d3fb5d50a93206333
parent8e358a02761106abcfaac5eb8c59e44ba923e8ca (diff)
downloadlinux-stable-66d53cd683a82eabecdc1367bfa9a0abce5d1e13.tar.gz
linux-stable-66d53cd683a82eabecdc1367bfa9a0abce5d1e13.tar.bz2
linux-stable-66d53cd683a82eabecdc1367bfa9a0abce5d1e13.zip
tools: gpio: Use !building_out_of_srctree to determine srctree
commit 4a6a6f5c4aeedb72db871d60bfcca89835f317aa upstream. 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: stable@vger.kernel.org Signed-off-by: Shuah Khan <skhan@linuxfoundation.org> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--tools/gpio/Makefile6
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/gpio/Makefile b/tools/gpio/Makefile
index 240eda014b37..f8bc8656a544 100644
--- a/tools/gpio/Makefile
+++ b/tools/gpio/Makefile
@@ -3,7 +3,11 @@ include ../scripts/Makefile.include
bindir ?= /usr/bin
-ifeq ($(srctree),)
+# This will work when gpio is built in tools env. where srctree
+# isn't set and when invoked from selftests build, where srctree
+# is set to ".". building_out_of_srctree is undefined for in srctree
+# builds
+ifndef building_out_of_srctree
srctree := $(patsubst %/,%,$(dir $(CURDIR)))
srctree := $(patsubst %/,%,$(dir $(srctree)))
endif