All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ben Hutchings <ben-/+tVBieCtBitmTQ+vhA3Yw@public.gmane.org>
To: Shuah Khan <shuahkh-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org>
Cc: linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: [PATCH v2 selftests 2/6] selftests: memfd: Stop unnecessary rebuilds
Date: Mon, 2 Nov 2015 12:21:57 +0000	[thread overview]
Message-ID: <20151102122157.GC17015@decadent.org.uk> (raw)
In-Reply-To: <20151102122048.GA17015-/+tVBieCtBitmTQ+vhA3Yw@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 1168 bytes --]

Instead of explicitly running the compiler, add dependencies and take
advantage of implicit rules to build only as necessary.

Signed-off-by: Ben Hutchings <ben-/+tVBieCtBitmTQ+vhA3Yw@public.gmane.org>
---
 tools/testing/selftests/memfd/Makefile | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

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]"


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 811 bytes --]

  parent reply	other threads:[~2015-11-02 12:21 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-02 12:20 [PATCH v2 selftests 0/6] Fix some broken tests Ben Hutchings
     [not found] ` <20151102122048.GA17015-/+tVBieCtBitmTQ+vhA3Yw@public.gmane.org>
2015-11-02 12:21   ` [PATCH v2 selftests 1/6] selftests: Add missing #include directives Ben Hutchings
2015-11-02 12:21   ` Ben Hutchings [this message]
2015-11-02 12:22   ` [PATCH v2 selftests 3/6] selftests: kprobe: Choose an always-defined function to probe Ben Hutchings
2015-11-02 12:22   ` [PATCH v2 selftests 4/6] selftests: Make scripts executable Ben Hutchings
2015-11-02 12:22   ` [PATCH v2 selftests 5/6] selftests: vm: Try harder to allocate huge pages Ben Hutchings
2015-11-02 12:22   ` [PATCH v2 selftests 6/6] selftests: breakpoint: Actually build it Ben Hutchings
2015-11-04  0:00   ` [PATCH v2 selftests 0/6] Fix some broken tests Shuah Khan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151102122157.GC17015@decadent.org.uk \
    --to=ben-/+tvbiectbitmtq+vha3yw@public.gmane.org \
    --cc=linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=shuahkh-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.