public inbox for linux-kselftest@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Makefile: Fix separate output directory build of kselftests
@ 2022-02-23 19:10 Muhammad Usama Anjum
  2022-03-03 18:06 ` Muhammad Usama Anjum
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Muhammad Usama Anjum @ 2022-02-23 19:10 UTC (permalink / raw)
  To: Masahiro Yamada, Michal Marek, Nick Desaulniers
  Cc: Muhammad Usama Anjum, kernel, kernelci, shuah, linux-kselftest,
	keescook, linux-kbuild, linux-kernel

Build of kselftests fail if kernel's top most Makefile is used for
running or building kselftests with separate output directory. The
absolute path is needed to reference other files during this kind of
build. Set KBUILD_ABS_SRCTREE to use absolute path during the build. It
fixes the following different types of errors:

make kselftest-all O=/linux_mainline/build
Makefile:1080: ../scripts/Makefile.extrawarn: No such file or directory

make kselftest-all O=build
Makefile:1080: ../scripts/Makefile.extrawarn: No such file or directory

Signed-off-by: Muhammad Usama Anjum <usama.anjum@collabora.com>
---
I've tested this patch on top of next-20220217. The latest next-20220222
have missing patches.
---
 Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 86f633c2809ea..62b3eb8a102ab 100644
--- a/Makefile
+++ b/Makefile
@@ -1411,10 +1411,10 @@ tools/%: FORCE
 
 PHONY += kselftest
 kselftest:
-	$(Q)$(MAKE) -C $(srctree)/tools/testing/selftests run_tests
+	$(Q)$(MAKE) -C $(srctree)/tools/testing/selftests KBUILD_ABS_SRCTREE=1 run_tests
 
 kselftest-%: FORCE
-	$(Q)$(MAKE) -C $(srctree)/tools/testing/selftests $*
+	$(Q)$(MAKE) -C $(srctree)/tools/testing/selftests KBUILD_ABS_SRCTREE=1 $*
 
 PHONY += kselftest-merge
 kselftest-merge:
-- 
2.30.2


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

end of thread, other threads:[~2022-04-14 11:10 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-23 19:10 [PATCH] Makefile: Fix separate output directory build of kselftests Muhammad Usama Anjum
2022-03-03 18:06 ` Muhammad Usama Anjum
2022-03-03 21:32 ` Shuah Khan
2022-03-08  8:11   ` Muhammad Usama Anjum
2022-03-08 21:19     ` Shuah Khan
2022-03-10 17:06       ` Muhammad Usama Anjum
2022-03-17 10:48 ` Muhammad Usama Anjum
2022-03-17 18:08   ` Masahiro Yamada
2022-04-04 11:09     ` Muhammad Usama Anjum
2022-04-14 11:10       ` Muhammad Usama Anjum

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox