Drop date.c file, (use identical function from GMime instead).
[notmuch] / Makefile
1 PROGS=notmuch
2
3 WARN_FLAGS=-Wall -Wextra -Wmissing-declarations -Wwrite-strings -Wswitch-enum
4
5 NOTMUCH_DEPENDS_FLAGS=`pkg-config --cflags glib-2.0 gmime-2.4 talloc`
6 NOTMUCH_CXX_DEPENDS_FLAGS=$(NOTMUCH_DEPENDS_FLAGS) `xapian-config --cxxflags`
7
8 NOTMUCH_CFLAGS=$(WARN_FLAGS) -O0 -g $(NOTMUCH_DEPENDS_FLAGS)
9 NOTMUCH_CXXFLAGS=$(WARN_FLAGS) -O0 -g $(NOTMUCH_CXX_DEPENDS_FLAGS)
10
11 NOTMUCH_LDFLAGS=`pkg-config --libs glib-2.0 gmime-2.4 talloc` \
12                 `xapian-config --libs`
13
14 LIBRARY=                \
15         database.o      \
16         index.o         \
17         libsha1.o       \
18         message.o       \
19         message-file.o  \
20         query.o         \
21         sha1.o          \
22         tags.o          \
23         thread.o        \
24         xutil.o
25
26 MAIN=                   \
27         notmuch.o
28
29 all: $(PROGS)
30
31 %.o: %.cc
32         $(CXX) -c $(CFLAGS) $(CXXFLAGS) $(NOTMUCH_CXXFLAGS) $< -o $@
33
34 %.o: %.c
35         $(CC) -c $(CFLAGS) $(NOTMUCH_CFLAGS) $< -o $@
36
37 notmuch: $(MAIN) $(LIBRARY)
38         $(CC) $(NOTMUCH_LDFLAGS) $^ -o $@
39
40 Makefile.dep: *.c *.cc
41         $(CXX) -M $(CPPFLAGS) $(NOTMUCH_DEPENDS_FLAGS) \
42         $(NOTMUCH_CXX_DEPENDS_FLAGS) $^ > $@
43 -include Makefile.dep
44
45 notmuch.1.gz:
46         gzip --stdout notmuch.1 > notmuch.1.gz
47
48 install: notmuch.1.gz
49         install -C -D notmuch $(DESTDIR)/usr/bin/notmuch
50         install -C -D notmuch.1.gz $(DESTDIR)/usr/share/man/man1
51         install -C -D notmuch-completion.bash \
52                 $(DESTDIR)/etc/bash_completion.d/notmuch
53
54 clean:
55         rm -f $(PROGS) *.o Makefile.dep