]> git.notmuchmail.org Git - notmuch/blobdiff - Makefile
Add notmuch_status_to_string function.
[notmuch] / Makefile
index c1fbd2a19bcc2d6f09c67677b25073660fb6009f..ff654e11e7944624d55aaa3ab86c98028f35bfe3 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,18 +1,24 @@
-PROGS=notmuch notmuch-index-message xapian-dump
+PROGS=notmuch
 
-MYCFLAGS=-Wall -O0 -g
-MYCXXFLAGS=-Wall -O0 -g
+MYCFLAGS=-Wall -O0 -g `pkg-config --cflags glib-2.0 talloc`
+MYCXXFLAGS=$(MYCFLAGS) `xapian-config --cxxflags`
+
+MYLDFLAGS=`pkg-config --libs glib-2.0 talloc` `xapian-config --libs`
 
 all: $(PROGS)
 
-notmuch: notmuch.c
-       $(CC) $(CFLAGS) $(MYCFLAGS) notmuch.c `pkg-config --cflags --libs glib-2.0` -o notmuch
+%.o: %.cc
+       $(CXX) -c $(CXXFLAGS) $(MYCXXFLAGS) $< -o $@
+
+%.o: %.c
+       $(CC) -c $(CFLAGS) $(MYCFLAGS) $< -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
+notmuch: notmuch.o database.o date.o message.o message-file.o query.o xutil.o
+       $(CC) $(MYLDFLAGS) $^ -o $@
 
-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)
+       rm -f $(PROGS) *.o Makefile.dep