]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - tools/gpio/Makefile
tools: gpio: Use !building_out_of_srctree to determine srctree
[linux.git] / tools / gpio / Makefile
index 6ecdd10678260f278475787af8d7b1e61e970bae..1178d302757ea71977e95d6880445839434fcf4b 100644 (file)
@@ -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