]> git.itanic.dy.fi Git - rrdd/commitdiff
Ensure proper dependency creation when only headers change
authorTimo Kokkonen <kaapeli@ee.oulu.fi>
Mon, 31 Mar 2008 18:51:14 +0000 (21:51 +0300)
committerTimo Kokkonen <kaapeli@ee.oulu.fi>
Mon, 31 Mar 2008 18:51:14 +0000 (21:51 +0300)
Makefile

index c854ede1fe8e928235921c5c30d7a800e1bc00e4..494cf255a178c6ef4855a355bff17d6dcbd27dde 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -12,8 +12,15 @@ all: rrdd
 clean:
        rm -vf rrdd *~ *.o *.d
 
+.c.o:
+       $(CC) $(CFLAGS) -c $< -o $@
+
 %.d: %.c
        $(CC) -MM $(CFLAGS) -c $< > $@ 
+       mv $@ $@.foo
+       cat $@.foo | sed -e s,.o,.d, > $@
+       cat $@.foo >> $@
+       rm $@.foo
 
 TAGS:
        etags *.[ch]