Skip to content

Commit

Permalink
tools: gpio: Use !building_out_of_srctree to determine srctree
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Shuah Khan authored and Bartosz Golaszewski committed Oct 22, 2019
1 parent 7d194c2 commit 4a6a6f5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tools/gpio/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4a6a6f5

Please sign in to comment.