summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Kacur <jkacur@redhat.com>2015-10-14 14:39:33 +0200
committerJohn Kacur <jkacur@redhat.com>2015-10-14 14:39:33 +0200
commit01c2ad58d34d33cbc706cee67df306c1a6d636e8 (patch)
tree7e5376afa940fe1b113717263b0f4c3768195bc5
parentd68bda3d43bf9d79c633e4223eda8c4dac51b4e6 (diff)
downloadrt-tests-01c2ad58d34d33cbc706cee67df306c1a6d636e8.tar.gz
Makefile: OBJDIR should be an order-only-prerequisite
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>
-rw-r--r--Makefile6
1 files changed, 3 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 1c3ae50..37ab159 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)