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@xxxxxxxxxx> --- 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 -- To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html