linux-kselftest.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RESEND] tools: gpio: Use !building_out_of_srctree to determine srctree
@ 2019-09-27  1:16 Shuah Khan
  2019-10-03  8:23 ` Bartosz Golaszewski
  0 siblings, 1 reply; 2+ messages in thread
From: Shuah Khan @ 2019-09-27  1:16 UTC (permalink / raw)
  To: linus.walleij, bgolaszewski
  Cc: Shuah Khan, linux-gpio, linux-kernel, linux-kselftest

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.

Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
---
Rsending with corrected address for linux-kselftest@vger.kernel.org

 tools/gpio/Makefile | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/tools/gpio/Makefile b/tools/gpio/Makefile
index 6ecdd1067826..1178d302757e 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
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH RESEND] tools: gpio: Use !building_out_of_srctree to determine srctree
  2019-09-27  1:16 [PATCH RESEND] tools: gpio: Use !building_out_of_srctree to determine srctree Shuah Khan
@ 2019-10-03  8:23 ` Bartosz Golaszewski
  0 siblings, 0 replies; 2+ messages in thread
From: Bartosz Golaszewski @ 2019-10-03  8:23 UTC (permalink / raw)
  To: Shuah Khan; +Cc: Linus Walleij, linux-gpio, LKML, linux-kselftest

pt., 27 wrz 2019 o 03:16 Shuah Khan <skhan@linuxfoundation.org> napisał(a):
>
> 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.
>
> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
> ---
> Rsending with corrected address for linux-kselftest@vger.kernel.org
>
>  tools/gpio/Makefile | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/tools/gpio/Makefile b/tools/gpio/Makefile
> index 6ecdd1067826..1178d302757e 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
> --
> 2.20.1
>

Applied for fixes, thanks!

Bart

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-10-03  8:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-27  1:16 [PATCH RESEND] tools: gpio: Use !building_out_of_srctree to determine srctree Shuah Khan
2019-10-03  8:23 ` Bartosz Golaszewski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).