]> git.notmuchmail.org Git - notmuch/blob - Makefile
7743ef52cf98f0b3babd0cd99d9c8c47f6de49bb
[notmuch] / Makefile
1 WARN_FLAGS=-Wall -Wextra -Wmissing-declarations -Wwrite-strings -Wswitch-enum
2
3 NOTMUCH_DEPENDS_FLAGS=-I./lib `pkg-config --cflags glib-2.0 gmime-2.4 talloc`
4 NOTMUCH_CXX_DEPENDS_FLAGS=$(NOTMUCH_DEPENDS_FLAGS) `xapian-config --cxxflags`
5
6 NOTMUCH_CFLAGS=$(WARN_FLAGS) -O0 -g $(NOTMUCH_DEPENDS_FLAGS)
7 NOTMUCH_CXXFLAGS=$(WARN_FLAGS) -O0 -g $(NOTMUCH_CXX_DEPENDS_FLAGS)
8
9 NOTMUCH_LDFLAGS=`pkg-config --libs glib-2.0 gmime-2.4 talloc` \
10                 `xapian-config --libs`
11
12 # Include our local Makfile.local first so that its first target is default
13 include Makefile.local
14 include lib/Makefile.local
15
16 %.o: %.cc
17         $(CXX) -c $(CFLAGS) $(CXXFLAGS) $(NOTMUCH_CXXFLAGS) $< -o $@
18
19 %.o: %.c
20         $(CC) -c $(CFLAGS) $(NOTMUCH_CFLAGS) $< -o $@
21
22 .deps/%.d: %.c
23         @set -e; rm -f $@; mkdir -p $$(dirname $@) ; \
24         $(CC) -M $(CPPFLAGS) $(NOTMUCH_DEPENDS_FLAGS) $< > $@.$$$$; \
25         sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \
26         rm -f $@.$$$$
27
28 .deps/%.d: %.cc
29         @set -e; rm -f $@; mkdir -p $$(dirname $@) ; \
30         $(CXX) -M $(CPPFLAGS) $(NOTMUCH_CXX_DEPENDS_FLAGS) $< > $@.$$$$; \
31         sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \
32         rm -f $@.$$$$
33
34 DEPS := $(SRCS:%.c=.deps/%.d)
35 DEPS := $(DEPS:%.cc=.deps/%.d)
36 -include $(DEPS)
37
38 clean:
39         rm -f $(CLEAN); rm -rf .deps