1 SONAME = libnotmuch.so.1
2 WARN_CXXFLAGS=-Wall -Wextra -Wwrite-strings -Wswitch-enum
3 WARN_CFLAGS=$(WARN_CXXFLAGS) -Wmissing-declarations
5 # Additional programs that are used during the compilation process.
7 # Lowercase to avoid clash with GZIP environment variable for passing
11 bash_completion_dir = /etc/bash_completion.d
12 zsh_completion_dir = /usr/share/zsh/functions/Completion/Unix
17 # Now smash together user's values with our extra values
18 FINAL_CFLAGS = $(CFLAGS) $(WARN_CFLAGS) $(CONFIGURE_CFLAGS) $(extra_cflags)
19 FINAL_CXXFLAGS = $(CXXFLAGS) $(WARN_CXXFLAGS) $(CONFIGURE_CXXFLAGS) $(extra_cflags) $(extra_cxxflags)
20 FINAL_LDFLAGS = $(LDFLAGS) $(CONFIGURE_LDFLAGS)
22 all: notmuch notmuch.1.gz
23 ifeq ($(MAKECMDGOALS),)
25 @echo "Compilation of notmuch is now complete. You can install notmuch with:"
29 @echo "Note that depending on the prefix to which you are installing"
30 @echo "you may need root permission (such as \"sudo make install\")."
31 @echo "See \"./configure --help\" for help on setting an alternate prefix."
34 # Before including any other Makefile fragments, get settings from the
36 Makefile.config: configure
38 @echo "Note: Calling ./configure with no command-line arguments. This is often fine,"
39 @echo " but if you want to specify any arguments (such as an alternate prefix"
40 @echo " into which to install), call ./configure explicitly and then make again."
41 @echo " See \"./configure --help\" for more details."
45 subdirs = compat emacs lib
47 global_deps = Makefile Makefile.config Makefile.local \
48 $(subdirs:%=%/Makefile) $(subdirs:%=%/Makefile.local)
50 include Makefile.config Makefile.local $(subdirs:%=%/Makefile.local)
52 # The user has not set any verbosity, default to quiet mode and inform the
53 # user how to enable verbose compiles.
55 quiet_DOC := "Use \"$(MAKE) V=1\" to see the verbose compile lines.\n"
56 quiet = @printf $(quiet_DOC)$(eval quiet_DOC:=)" $1 $2 $@\n"; $($1)
58 # The user has explicitly enabled quiet compilation.
60 quiet = @printf " $1 $@\n"; $($1)
62 # Otherwise, print the full command line.
65 %.o: %.cc $(global_deps)
66 $(call quiet,CXX,$(CXXFLAGS)) -c $(FINAL_CXXFLAGS) $< -o $@
68 %.o: %.c $(global_deps)
69 $(call quiet,CC,$(CFLAGS)) -c $(FINAL_CFLAGS) $< -o $@
72 $(call quiet,EMACS) -batch -f batch-byte-compile $<
74 .deps/%.d: %.c $(global_deps)
75 @set -e; rm -f $@; mkdir -p $$(dirname $@) ; \
76 $(CC) -M $(CPPFLAGS) $(FINAL_CFLAGS) $< > $@.$$$$ 2>/dev/null ; \
77 sed 's,'$$(basename $*)'\.o[ :]*,$*.o $@ : ,g' < $@.$$$$ > $@; \
80 .deps/%.d: %.cc $(global_deps)
81 @set -e; rm -f $@; mkdir -p $$(dirname $@) ; \
82 $(CXX) -M $(CPPFLAGS) $(FINAL_CXXFLAGS) $< > $@.$$$$ 2>/dev/null ; \
83 sed 's,'$$(basename $*)'\.o[ :]*,$*.o $@ : ,g' < $@.$$$$ > $@; \
86 DEPS := $(SRCS:%.c=.deps/%.d)
87 DEPS := $(DEPS:%.cc=.deps/%.d)
92 rm -f $(CLEAN); rm -rf .deps