]> git.notmuchmail.org Git - notmuch/blob - Makefile
bash-completion: Complete options for notmuch search
[notmuch] / Makefile
1 # Default FLAGS, (can be overridden by user such as "make CFLAGS=-O2")
2 WARN_FLAGS=-Wall -Wextra -Wmissing-declarations -Wwrite-strings -Wswitch-enum
3 CFLAGS=-O2
4
5 # Additional flags that we will append to whatever the user set.
6 # These aren't intended for the user to manipulate.
7 extra_cflags := $(shell pkg-config --cflags glib-2.0 gmime-2.4 talloc)
8 extra_cxxflags := $(shell xapian-config --cxxflags)
9
10 # Now smash together user's values with our extra values
11 override CFLAGS += $(WARN_FLAGS) $(extra_cflags)
12 override CXXFLAGS += $(WARN_FLAGS) $(extra_cflags) $(extra_cxxflags)
13
14 override LDFLAGS += \
15         $(shell pkg-config --libs glib-2.0 gmime-2.4 talloc) \
16         $(shell xapian-config --libs)
17
18 # Include our local Makefile.local first so that its first target is default
19 include Makefile.local
20 include lib/Makefile.local
21
22 # And get user settings from the output of configure
23 include Makefile.config
24
25 %.o: %.cc
26         $(CXX) -c $(CFLAGS) $(CXXFLAGS) $< -o $@
27
28 %.o: %.c
29         $(CC) -c $(CFLAGS) $< -o $@
30
31 .deps/%.d: %.c
32         @set -e; rm -f $@; mkdir -p $$(dirname $@) ; \
33         $(CC) -M $(CPPFLAGS) $(CFLAGS) $< > $@.$$$$; \
34         sed 's,'$$(basename $*)'\.o[ :]*,$*.o $@ : ,g' < $@.$$$$ > $@; \
35         rm -f $@.$$$$
36
37 .deps/%.d: %.cc
38         @set -e; rm -f $@; mkdir -p $$(dirname $@) ; \
39         $(CXX) -M $(CPPFLAGS) $(CXXFLAGS) $< > $@.$$$$; \
40         sed 's,'$$(basename $*)'\.o[ :]*,$*.o $@ : ,g' < $@.$$$$ > $@; \
41         rm -f $@.$$$$
42
43 DEPS := $(SRCS:%.c=.deps/%.d)
44 DEPS := $(DEPS:%.cc=.deps/%.d)
45 -include $(DEPS)
46
47 clean:
48         rm -f $(CLEAN); rm -rf .deps