diff options
author | Shuah Khan <skhan@linuxfoundation.org> | 2019-05-14 16:43:44 -0400 |
---|---|---|
committer | Shuah Khan <skhan@linuxfoundation.org> | 2019-05-14 19:37:41 -0400 |
commit | 61c2018c0743fe0c9ca68e308b5727b8a7c3d544 (patch) | |
tree | 090b2307603d829ae63dde5b38bc451d3f9fbeba | |
parent | 11ebd85a07e0c84b037a47a19a040b31d7869df3 (diff) |
selftests: avoid KBUILD_OUTPUT dir cluttering with selftest objects
Running "make kselftest" or building selftests when KBUILD_OUTPUT
is set, will create selftest objects in the KBUILD_OUTPUT directory.
This could be undesirable especially when user didn't intend to
relocate selftest objects.
Use KBUILD_OUTPUT/kselftest to create selftest objects instead of
cluttering the main directory.
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
-rw-r--r-- | tools/testing/selftests/Makefile | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Makefile index c71a63b923d4..9781ca79794a 100644 --- a/tools/testing/selftests/Makefile +++ b/tools/testing/selftests/Makefile | |||
@@ -71,6 +71,9 @@ override LDFLAGS = | |||
71 | override MAKEFLAGS = | 71 | override MAKEFLAGS = |
72 | endif | 72 | endif |
73 | 73 | ||
74 | # Append kselftest to KBUILD_OUTPUT to avoid cluttering | ||
75 | # KBUILD_OUTPUT with selftest objects and headers installed | ||
76 | # by selftests Makefile or lib.mk. | ||
74 | ifneq ($(KBUILD_SRC),) | 77 | ifneq ($(KBUILD_SRC),) |
75 | override LDFLAGS = | 78 | override LDFLAGS = |
76 | endif | 79 | endif |
@@ -79,7 +82,7 @@ ifneq ($(O),) | |||
79 | BUILD := $(O) | 82 | BUILD := $(O) |
80 | else | 83 | else |
81 | ifneq ($(KBUILD_OUTPUT),) | 84 | ifneq ($(KBUILD_OUTPUT),) |
82 | BUILD := $(KBUILD_OUTPUT) | 85 | BUILD := $(KBUILD_OUTPUT)/kselftest |
83 | else | 86 | else |
84 | BUILD := $(shell pwd) | 87 | BUILD := $(shell pwd) |
85 | DEFAULT_INSTALL_HDR_PATH := 1 | 88 | DEFAULT_INSTALL_HDR_PATH := 1 |