From: Ben Hutchings Date: Mon, 2 Nov 2015 12:21:57 +0000 (+0000) Subject: selftests: memfd: Stop unnecessary rebuilds X-Git-Tag: v4.4-rc1~43^2~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=55f4d731c5b27f3dfe7eaeeb136cd60312f50270;p=profile%2Fcommon%2Fplatform%2Fkernel%2Flinux-artik7.git selftests: memfd: Stop unnecessary rebuilds Instead of explicitly running the compiler, add dependencies and take advantage of implicit rules to build only as necessary. Signed-off-by: Ben Hutchings Signed-off-by: Shuah Khan --- diff --git a/tools/testing/selftests/memfd/Makefile b/tools/testing/selftests/memfd/Makefile index 3e7eb79..fd396ac 100644 --- a/tools/testing/selftests/memfd/Makefile +++ b/tools/testing/selftests/memfd/Makefile @@ -4,16 +4,16 @@ CFLAGS += -I../../../../include/uapi/ CFLAGS += -I../../../../include/ CFLAGS += -I../../../../usr/include/ -all: - $(CC) $(CFLAGS) memfd_test.c -o memfd_test - TEST_PROGS := memfd_test +all: $(TEST_PROGS) + include ../lib.mk -build_fuse: - $(CC) $(CFLAGS) fuse_mnt.c `pkg-config fuse --cflags --libs` -o fuse_mnt - $(CC) $(CFLAGS) fuse_test.c -o fuse_test +build_fuse: fuse_mnt fuse_test + +fuse_mnt.o: CFLAGS += $(shell pkg-config fuse --cflags) +fuse_mnt: LDFLAGS += $(shell pkg-config fuse --libs) run_fuse: build_fuse @./run_fuse_test.sh || echo "fuse_test: [FAIL]"