linux-rt-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: John Kacur <jkacur@redhat.com>
To: rt-users <linux-rt-users@vger.kernel.org>
Cc: Clark Williams <williams@redhat.com>, John Kacur <jkacur@redhat.com>
Subject: [PATCH 4/7] Makefile: OBJDIR should be an order-only-prerequisite
Date: Wed, 14 Oct 2015 15:32:15 +0200	[thread overview]
Message-ID: <1444829538-18465-5-git-send-email-jkacur@redhat.com> (raw)
In-Reply-To: <1444829538-18465-1-git-send-email-jkacur@redhat.com>

OBJDIR should be an order only prerequisite.
- create the OBJDIR if necessary before .d, .o and before all TARGETS
  including hwlatdetect
- Don't rebuild if the timestamp on the OBJDIR changes

Signed-off-by: John Kacur <jkacur@redhat.com>
---
 Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index 1c3ae50030d6..37ab159e84f9 100644
--- a/Makefile
+++ b/Makefile
@@ -85,15 +85,15 @@ VPATH	+= src/backfire:
 VPATH	+= src/lib:
 VPATH	+= src/hackbench:
 
-$(OBJDIR)/%.o: %.c
+$(OBJDIR)/%.o: %.c | $(OBJDIR)
 	$(CC) -D VERSION=$(VERSION) -c $< $(CFLAGS) $(CPPFLAGS) -o $@
 
 # Pattern rule to generate dependency files from .c files
-$(OBJDIR)/%.d: %.c
+$(OBJDIR)/%.d: %.c | $(OBJDIR)
 	@$(CC) -MM $(CFLAGS) $(CPPFLAGS) $< | sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' > $@ || rm -f $@
 
 .PHONY: all
-all: $(OBJDIR) $(TARGETS) hwlatdetect
+all: $(TARGETS) hwlatdetect | $(OBJDIR)
 
 $(OBJDIR):
 	mkdir $(OBJDIR)
-- 
2.4.3


  parent reply	other threads:[~2015-10-14 13:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-14 13:32 [PATCH 0/7] rt-tests devel/v0.96 John Kacur
2015-10-14 13:32 ` [PATCH 1/7] cyclictest: Clean-ups in timerthread before working on it John Kacur
2015-10-14 13:32 ` [PATCH 2/7] Fix some trivial typos found by codespell(1) John Kacur
2015-10-14 13:32 ` [PATCH 3/7] Makefile: add target to create OBJDIR before use John Kacur
2015-10-14 13:32 ` John Kacur [this message]
2015-10-14 13:32 ` [PATCH 5/7] specfile: add signaltest manpage to files section and remove trailing whitespace in changelog John Kacur
2015-10-15  8:52   ` Uwe Kleine-König
2015-10-15  8:53     ` Uwe Kleine-König
2015-10-14 13:32 ` [PATCH 6/7] Makefile: have distclean remove .asc file for tarball John Kacur
2015-10-14 13:32 ` [PATCH 7/7] Makefile: Move TARGETS back to a more logical place in the Makefile John Kacur

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=1444829538-18465-5-git-send-email-jkacur@redhat.com \
    --to=jkacur@redhat.com \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=williams@redhat.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).