aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tools/testing/selftests/Makefile
diff options
context:
space:
mode:
authorShuah Khan <skhan@linuxfoundation.org>2019-05-14 14:43:44 -0600
committerShuah Khan <skhan@linuxfoundation.org>2019-05-14 17:37:41 -0600
commit61c2018c0743fe0c9ca68e308b5727b8a7c3d544 (patch)
tree090b2307603d829ae63dde5b38bc451d3f9fbeba /tools/testing/selftests/Makefile
parentselftests: drivers: Create .gitignore to include /dma-buf/udmabuf (diff)
downloadwireguard-linux-61c2018c0743fe0c9ca68e308b5727b8a7c3d544.tar.xz
wireguard-linux-61c2018c0743fe0c9ca68e308b5727b8a7c3d544.zip
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>
Diffstat (limited to 'tools/testing/selftests/Makefile')
-rw-r--r--tools/testing/selftests/Makefile5
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 =
override MAKEFLAGS =
endif
+# Append kselftest to KBUILD_OUTPUT to avoid cluttering
+# KBUILD_OUTPUT with selftest objects and headers installed
+# by selftests Makefile or lib.mk.
ifneq ($(KBUILD_SRC),)
override LDFLAGS =
endif
@@ -79,7 +82,7 @@ ifneq ($(O),)
BUILD := $(O)
else
ifneq ($(KBUILD_OUTPUT),)
- BUILD := $(KBUILD_OUTPUT)
+ BUILD := $(KBUILD_OUTPUT)/kselftest
else
BUILD := $(shell pwd)
DEFAULT_INSTALL_HDR_PATH := 1