diff options
author | John Kacur <jkacur@redhat.com> | 2015-10-14 14:39:33 +0200 |
---|---|---|
committer | John Kacur <jkacur@redhat.com> | 2015-10-14 14:39:33 +0200 |
commit | 01c2ad58d34d33cbc706cee67df306c1a6d636e8 (patch) | |
tree | 7e5376afa940fe1b113717263b0f4c3768195bc5 | |
parent | d68bda3d43bf9d79c633e4223eda8c4dac51b4e6 (diff) | |
download | rt-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-- | Makefile | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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) |