From 6a6b11f436c822cac154da5a60c4cc6baa6a8008 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Wed, 25 Nov 2015 21:24:01 -0700 Subject: [PATCH] Makefile: generate .d dep file for init.c Could be cleaner, we're duplicating the general .c rule here. But as a quickie, let's hope it fixes up the rebuild issues when init.c dependencies have changed. Signed-off-by: Jens Axboe --- Makefile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Makefile b/Makefile index 0b506e8e..e30273ce 100644 --- a/Makefile +++ b/Makefile @@ -324,7 +324,14 @@ parse.o: lex.yy.o y.tab.o endif init.o: init.c FIO-VERSION-FILE + @mkdir -p $(dir $@) $(QUIET_CC)$(CC) -o $@ $(CFLAGS) $(CPPFLAGS) -c $< + @$(CC) -MM $(CFLAGS) $(CPPFLAGS) $(SRCDIR)/$*.c > $*.d + @mv -f $*.d $*.d.tmp + @sed -e 's|.*:|$*.o:|' < $*.d.tmp > $*.d + @sed -e 's/.*://' -e 's/\\$$//' < $*.d.tmp | fmt -1 | \ + sed -e 's/^ *//' -e 's/$$/:/' >> $*.d + @rm -f $*.d.tmp gcompat.o: gcompat.c gcompat.h $(QUIET_CC)$(CC) $(CFLAGS) $(GTK_CFLAGS) $(CPPFLAGS) -c $< -- 2.25.1