aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/vm/Makefile
diff options
context:
space:
mode:
authorbamvor.zhangjian@huawei.com <bamvor.zhangjian@huawei.com>2016-11-29 19:55:49 +0800
committerShuah Khan <shuahkh@osg.samsung.com>2017-01-05 13:42:01 -0700
commit7d758af257bc40a8a599a0aaa4768b30fb463e9c (patch)
tree00c4ae2a68d491c2d8849564211b1121cdd9cc2d /tools/testing/selftests/vm/Makefile
parentselftests: remove useless TEST_DIRS (diff)
downloadlinux-dev-7d758af257bc40a8a599a0aaa4768b30fb463e9c.tar.xz
linux-dev-7d758af257bc40a8a599a0aaa4768b30fb463e9c.zip
selftests: add default rules for c source file
There are difference rules for compiling c source file in different testcases. In order to enable KBUILD_OUTPUT support in later patch, this patch introduce the default rules in "tools/testing/selftest/lib.mk" and remove the existing rules in each testcase. Acked-by: Michael Ellerman <mpe@ellerman.id.au> Signed-off-by: Bamvor Jian Zhang <bamvor.zhangjian@linaro.org> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Diffstat (limited to '')
-rw-r--r--tools/testing/selftests/vm/Makefile17
1 files changed, 6 insertions, 11 deletions
diff --git a/tools/testing/selftests/vm/Makefile b/tools/testing/selftests/vm/Makefile
index 323383ab4581..8141d5169f4d 100644
--- a/tools/testing/selftests/vm/Makefile
+++ b/tools/testing/selftests/vm/Makefile
@@ -1,6 +1,7 @@
# Makefile for vm selftests
CFLAGS = -Wall -I ../../../../usr/include $(EXTRA_CFLAGS)
+LDLIBS = -lrt
TEST_GEN_FILES = compaction_test
TEST_GEN_FILES += hugepage-mmap
TEST_GEN_FILES += hugepage-shm
@@ -12,18 +13,12 @@ TEST_GEN_FILES += transhuge-stress
TEST_GEN_FILES += userfaultfd
TEST_GEN_FILES += mlock-random-test
-%: %.c
- $(CC) $(CFLAGS) -o $@ $^ -lrt
-userfaultfd: userfaultfd.c ../../../../usr/include/linux/kernel.h
- $(CC) $(CFLAGS) -O2 -o $@ $< -lpthread
-
-mlock-random-test: mlock-random-test.c
- $(CC) $(CFLAGS) -o $@ $< -lcap
-
-../../../../usr/include/linux/kernel.h:
- make -C ../../../.. headers_install
-
TEST_PROGS := run_vmtests
include ../lib.mk
+userfaultfd: LDLIBS += -lpthread ../../../../usr/include/linux/kernel.h
+mlock-random-test: LDLIBS += -lcap
+
+../../../../usr/include/linux/kernel.h:
+ make -C ../../../.. headers_install