f105761625ce8b48cfb925a397ee4c42a506d903
[notmuch] / Makefile
1 PROGS=notmuch
2
3 CXXWARNINGS_FLAGS=-Wall -Wextra -Wmissing-declarations -Wwrite-strings \
4 -Wswitch-enum
5 CWARNINGS_FLAGS=$(CXXWARNINGS_FLAGS)
6
7 CDEPENDS_FLAGS=`pkg-config --cflags glib-2.0 talloc`
8 CXXDEPENDS_FLAGS=`pkg-config --cflags glib-2.0 talloc` `xapian-config --cxxflags`
9
10 MYCFLAGS=$(CWARNINGS_FLAGS) -O0 -g $(CDEPENDS_FLAGS)
11 MYCXXFLAGS=$(CXXWARNINGS_FLAGS) -O0 -g $(CXXDEPENDS_FLAGS)
12
13 MYLDFLAGS=`pkg-config --libs glib-2.0 talloc` `xapian-config --libs`
14
15 MODULES=                \
16         notmuch.o       \
17         database.o      \
18         date.o          \
19         message.o       \
20         message-file.o  \
21         query.o         \
22         sha1.o          \
23         libsha1.o       \
24         xutil.o
25
26 all: $(PROGS)
27
28 %.o: %.cc
29         $(CXX) -c $(CFLAGS) $(CXXFLAGS) $(MYCXXFLAGS) $< -o $@
30
31 %.o: %.c
32         $(CC) -c $(CFLAGS) $(MYCFLAGS) $< -o $@
33
34 notmuch: $(MODULES)
35         $(CC) $(MYLDFLAGS) $^ -o $@
36
37 Makefile.dep: *.c *.cc
38         $(CC) -M $(CPPFLAGS) $(CDEPENDS_FLAGS) $^ > $@
39 -include Makefile.dep
40
41 clean:
42         rm -f $(PROGS) *.o Makefile.dep