]> git.notmuchmail.org Git - notmuch/commitdiff
Makefile: Add automatic dependency tracking to the Makefile.
authorCarl Worth <cworth@cworth.org>
Tue, 20 Oct 2009 22:08:03 +0000 (15:08 -0700)
committerCarl Worth <cworth@cworth.org>
Tue, 20 Oct 2009 22:09:18 +0000 (15:09 -0700)
With this, I really don't miss anything from automake.

Makefile

index 7c15d6c1f0a5b7c88136bcdb7f6e1dc84cc2b44d..86516402c2eda51d4d628f3cbb61a93240afde85 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -8,13 +8,17 @@ MYLDFLAGS=`pkg-config --libs glib-2.0` `xapian-config --libs`
 all: $(PROGS)
 
 %.o: %.cc
-       $(CXX) -c $(CXXFLAGS) $(MYCXXFLAGS) $^ -o $@
+       $(CXX) -c $(CXXFLAGS) $(MYCXXFLAGS) $< -o $@
 
 %.o: %.c
-       $(CC) -c $(CFLAGS) $(MYCFLAGS) $^ -o $@
+       $(CC) -c $(CFLAGS) $(MYCFLAGS) $< -o $@
 
 notmuch: notmuch.o database.o date.o message.o xutil.o
        $(CC) $(MYLDFLAGS) $^ -o $@
 
+Makefile.dep: *.c *.cc
+       $(CC) -M $(CPPFLAGS) $(MYCFLAGS) $^ > $@
+-include Makefile.dep
+
 clean:
-       rm -f $(PROGS) *.o
+       rm -f $(PROGS) *.o Makefile.dep