aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tools/testing/selftests/exec/Makefile
diff options
context:
space:
mode:
authorbamvor.zhangjian@huawei.com <bamvor.zhangjian@huawei.com>2016-11-29 19:55:52 +0800
committerShuah Khan <shuahkh@osg.samsung.com>2017-01-05 13:42:22 -0700
commita8ba798bc8ec663cf02e80b0dd770324de9bafd9 (patch)
treee654822d4a82b46dc087febceb4d79999fd51488 /tools/testing/selftests/exec/Makefile
parentselftests: add EXTRA_CLEAN for clean target (diff)
downloadwireguard-linux-a8ba798bc8ec663cf02e80b0dd770324de9bafd9.tar.xz
wireguard-linux-a8ba798bc8ec663cf02e80b0dd770324de9bafd9.zip
selftests: enable O and KBUILD_OUTPUT
Enable O and KBUILD_OUTPUT for kselftest. User could compile kselftest to another directory by passing O or KBUILD_OUTPUT. And O is high priority than KBUILD_OUTPUT. Signed-off-by: Bamvor Jian Zhang <bamvor.zhangjian@linaro.org> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Diffstat (limited to 'tools/testing/selftests/exec/Makefile')
-rw-r--r--tools/testing/selftests/exec/Makefile13
1 files changed, 7 insertions, 6 deletions
diff --git a/tools/testing/selftests/exec/Makefile b/tools/testing/selftests/exec/Makefile
index 48d1f863d584..2e13035dff7f 100644
--- a/tools/testing/selftests/exec/Makefile
+++ b/tools/testing/selftests/exec/Makefile
@@ -5,18 +5,19 @@ TEST_GEN_FILES := execveat.symlink execveat.denatured script subdir
# Makefile is a run-time dependency, since it's accessed by the execveat test
TEST_FILES := Makefile
-EXTRA_CLEAN := subdir.moved execveat.moved xxxxx*
+EXTRA_CLEAN := $(OUTPUT)/subdir.moved $(OUTPUT)/execveat.moved $(OUTPUT)/xxxxx*
include ../lib.mk
-subdir:
+$(OUTPUT)/subdir:
mkdir -p $@
-script:
+$(OUTPUT)/script:
echo '#!/bin/sh' > $@
echo 'exit $$*' >> $@
chmod +x $@
-execveat.symlink: execveat
- ln -s -f $< $@
-execveat.denatured: execveat
+$(OUTPUT)/execveat.symlink: $(OUTPUT)/execveat
+ cd $(OUTPUT) && ln -s -f $(shell basename $<) $(shell basename $@)
+$(OUTPUT)/execveat.denatured: $(OUTPUT)/execveat
cp $< $@
chmod -x $@
+