]> git.notmuchmail.org Git - notmuch/blobdiff - Makefile
notmuch.el: Add commands to add tag, remove tag, and archive (== remove inbox tag)
[notmuch] / Makefile
index 17f29fb1960c202e00c56d70d1b65586340a5ed5..26ab8da8e748b32beb143e4f92d7ab02707a5eb2 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,14 +1,49 @@
-PROGS=notmuch-index-message xapian-dump
+PROGS=notmuch
 
-MYCXXFLAGS=-Wall -O0 -g
+WARN_FLAGS=-Wall -Wextra -Wmissing-declarations -Wwrite-strings -Wswitch-enum
+
+CDEPENDS_FLAGS=`pkg-config --cflags glib-2.0 gmime-2.4 talloc`
+CXXDEPENDS_FLAGS=$(CDEPENDS_FLAGS) `xapian-config --cxxflags`
+
+MYCFLAGS=$(WARN_FLAGS) -O0 -g $(CDEPENDS_FLAGS)
+MYCXXFLAGS=$(WARN_FLAGS) -O0 -g $(CXXDEPENDS_FLAGS)
+
+MYLDFLAGS=`pkg-config --libs glib-2.0 gmime-2.4 talloc` `xapian-config --libs`
+
+LIBRARY=               \
+       database.o      \
+       date.o          \
+       index.o         \
+       libsha1.o       \
+       message.o       \
+       message-file.o  \
+       query.o         \
+       sha1.o          \
+       tags.o          \
+       thread.o        \
+       xutil.o
+
+MAIN=                  \
+       notmuch.o
 
 all: $(PROGS)
 
-notmuch-index-message: notmuch-index-message.cc
-       $(CC) $(CXXFLAGS) $(MYCXXFLAGS) notmuch-index-message.cc `pkg-config --cflags --libs gmime-2.4` `xapian-config --cxxflags --libs` -o notmuch-index-message
+%.o: %.cc
+       $(CXX) -c $(CFLAGS) $(CXXFLAGS) $(MYCXXFLAGS) $< -o $@
+
+%.o: %.c
+       $(CC) -c $(CFLAGS) $(MYCFLAGS) $< -o $@
+
+notmuch: $(MAIN) $(LIBRARY)
+       $(CC) $(MYLDFLAGS) $^ -o $@
+
+Makefile.dep: *.c *.cc
+       $(CXX) -M $(CPPFLAGS) $(CDEPENDS_FLAGS) $(CXXDEPENDS_FLAGS) $^ > $@
+-include Makefile.dep
 
-xapian-dump: xapian-dump.cc
-       $(CXX) $(CXXFLAGS) $(MYCXXFLAGS) xapian-dump.cc `xapian-config --libs --cxxflags` -o xapian-dump
+install:
+       install -C -D notmuch $(DESTDIR)/usr/bin/notmuch
+       install -C -D notmuch-completion.bash $(DESTDIR)/etc/bash_completion.d/notmuch
 
 clean:
-       rm -f $(PROGS)
+       rm -f $(PROGS) *.o Makefile.dep