aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShuah Khan <skhan@linuxfoundation.org>2020-03-25 15:28:05 -0600
committerShuah Khan <skhan@linuxfoundation.org>2020-03-25 17:25:24 -0600
commit8b444d50c37c0ae5b544063cb794d07651ccbaeb (patch)
treefd2f062536d0fc27be0bb810f3ace3c3ab82119d
parent7d830c9ed547f625ec7c64caf57f05b2ea1c609f (diff)
downloadlinux-kselftest-kernelci.tar.gz
selftests: Fix memfd to support relocatable build (O=objdir)kernelci
Fix memfd to support relocatable build (O=objdir). This calls out source files necessary to build tests and simplfies the dependency enforcement. Tested the following: Note that cross-build for fuse_mnt has dependency on -lfuse. make all make clean make kselftest-install O=/arm64_build/ ARCH=arm64 HOSTCC=gcc \ CROSS_COMPILE=aarch64-linux-gnu- TARGETS=memfd Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
-rw-r--r--tools/testing/selftests/memfd/Makefile9
1 files changed, 4 insertions, 5 deletions
diff --git a/tools/testing/selftests/memfd/Makefile b/tools/testing/selftests/memfd/Makefile
index 53a848109f7bb..0a15f9e234312 100644
--- a/tools/testing/selftests/memfd/Makefile
+++ b/tools/testing/selftests/memfd/Makefile
@@ -4,9 +4,8 @@ CFLAGS += -I../../../../include/uapi/
CFLAGS += -I../../../../include/
CFLAGS += -I../../../../usr/include/
-TEST_GEN_PROGS := memfd_test
+TEST_GEN_PROGS := memfd_test fuse_test fuse_mnt
TEST_PROGS := run_fuse_test.sh run_hugetlbfs_test.sh
-TEST_GEN_FILES := fuse_mnt fuse_test
fuse_mnt.o: CFLAGS += $(shell pkg-config fuse --cflags)
@@ -14,7 +13,7 @@ include ../lib.mk
$(OUTPUT)/fuse_mnt: LDLIBS += $(shell pkg-config fuse --libs)
-$(OUTPUT)/memfd_test: memfd_test.c common.o
-$(OUTPUT)/fuse_test: fuse_test.c common.o
+$(OUTPUT)/memfd_test: memfd_test.c common.c
+$(OUTPUT)/fuse_test: fuse_test.c common.c
-EXTRA_CLEAN = common.o
+EXTRA_CLEAN = $(OUTPUT)/common.o