1 # Default FLAGS, (can be overridden by user such as "make CFLAGS=-O2")
2 WARN_FLAGS=-Wall -Wextra -Wmissing-declarations -Wwrite-strings -Wswitch-enum
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)
10 emacs_lispdir := $(shell pkg-config emacs --variable sitepkglispdir)
12 # Now smash together user's values with our extra values
13 override CFLAGS += $(WARN_FLAGS) $(extra_cflags)
14 override CXXFLAGS += $(WARN_FLAGS) $(extra_cflags) $(extra_cxxflags)
17 $(shell pkg-config --libs glib-2.0 gmime-2.4 talloc) \
18 $(shell xapian-config --libs)
20 # Include our local Makefile.local first so that its first target is default
21 include Makefile.local
22 include lib/Makefile.local
24 # And get user settings from the output of configure
25 include Makefile.config
28 $(CXX) -c $(CFLAGS) $(CXXFLAGS) $< -o $@
31 $(CC) -c $(CFLAGS) $< -o $@
34 emacs -batch -f batch-byte-compile $<
37 @set -e; rm -f $@; mkdir -p $$(dirname $@) ; \
38 $(CC) -M $(CPPFLAGS) $(CFLAGS) $< > $@.$$$$; \
39 sed 's,'$$(basename $*)'\.o[ :]*,$*.o $@ : ,g' < $@.$$$$ > $@; \
43 @set -e; rm -f $@; mkdir -p $$(dirname $@) ; \
44 $(CXX) -M $(CPPFLAGS) $(CXXFLAGS) $< > $@.$$$$; \
45 sed 's,'$$(basename $*)'\.o[ :]*,$*.o $@ : ,g' < $@.$$$$ > $@; \
48 DEPS := $(SRCS:%.c=.deps/%.d)
49 DEPS := $(DEPS:%.cc=.deps/%.d)
53 rm -f $(CLEAN); rm -rf .deps