From 01c2ad58d34d33cbc706cee67df306c1a6d636e8 Mon Sep 17 00:00:00 2001 From: John Kacur Date: Wed, 14 Oct 2015 14:39:33 +0200 Subject: 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 --- Makefile | 6 +++--- 1 file 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) -- cgit 1.2.3-korg