]> git.notmuchmail.org Git - notmuch/blobdiff - Makefile
Makefile: Add automatic dependency tracking to the Makefile.
[notmuch] / Makefile
index 4af5a2ebfa5de2d38506e2dfd2e772bc30fe2ea0..86516402c2eda51d4d628f3cbb61a93240afde85 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,26 +1,24 @@
-PROGS=notmuch notmuch-index-message xapian-dump
+PROGS=notmuch
 
-MYCFLAGS=-Wall -O0 -g `pkg-config --cflags gmime-2.4`
+MYCFLAGS=-Wall -O0 -g `pkg-config --cflags glib-2.0`
 MYCXXFLAGS=$(MYCFLAGS) `xapian-config --cxxflags`
 
-MYLDFLAGS=`pkg-config --libs gmime-2.4` `xapian-config --libs`
+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 xutil.o
+notmuch: notmuch.o database.o date.o message.o xutil.o
        $(CC) $(MYLDFLAGS) $^ -o $@
 
-notmuch-index-message: notmuch-index-message.cc
-       $(CXX) $(CXXFLAGS) $(MYCXXFLAGS) notmuch-index-message.cc `pkg-config --cflags --libs gmime-2.4` `xapian-config --cxxflags --libs` -o notmuch-index-message
-
-xapian-dump: xapian-dump.cc
-       $(CXX) $(CXXFLAGS) $(MYCXXFLAGS) xapian-dump.cc `xapian-config --libs --cxxflags` -o xapian-dump
+Makefile.dep: *.c *.cc
+       $(CC) -M $(CPPFLAGS) $(MYCFLAGS) $^ > $@
+-include Makefile.dep
 
 clean:
-       rm -f $(PROGS) *.o
+       rm -f $(PROGS) *.o Makefile.dep