]> git.notmuchmail.org Git - notmuch/blob - Makefile
Makefile: Add a message after "make install-emacs"
[notmuch] / Makefile
1 WARN_CXXFLAGS=-Wall -Wextra -Wwrite-strings -Wswitch-enum
2 WARN_CFLAGS=$(WARN_CXXFLAGS) -Wmissing-declarations
3
4 # Additional programs that are used during the compilation process.
5 EMACS ?= emacs
6 # Lowercase to avoid clash with GZIP environment variable for passing
7 # arguments to gzip.
8 gzip = gzip
9
10 bash_completion_dir = /etc/bash_completion.d
11 zsh_completion_dir = /usr/share/zsh/functions/Completion/Unix
12
13 global_deps = Makefile Makefile.local Makefile.config \
14                    lib/Makefile lib/Makefile.local
15
16 extra_cflags :=
17 extra_cxxflags :=
18
19 # Now smash together user's values with our extra values
20 FINAL_CFLAGS = $(CFLAGS) $(WARN_CFLAGS) $(CONFIGURE_CFLAGS) $(extra_cflags)
21 FINAL_CXXFLAGS = $(CXXFLAGS) $(WARN_CXXFLAGS) $(CONFIGURE_CXXFLAGS) $(extra_cflags) $(extra_cxxflags)
22 FINAL_LDFLAGS = $(LDFLAGS) $(CONFIGURE_LDFLAGS)
23
24 all: notmuch notmuch.1.gz
25 ifeq ($(MAKECMDGOALS),)
26         @echo ""
27         @echo "Compilation of notmuch is now complete. You can install notmuch with:"
28         @echo ""
29         @echo " make install"
30         @echo ""
31         @echo "Note that depending on the prefix to which you are installing"
32         @echo "you may need root permission (such as \"sudo make install\")."
33         @echo "See \"./configure --help\" for help on setting an alternate prefix."
34 endif
35
36 # Before including any other Makefile fragments, get settings from the
37 # output of configure
38 Makefile.config: configure
39         @echo ""
40         @echo "Note: Calling ./configure with no command-line arguments. This is often fine,"
41         @echo "      but if you want to specify any arguments (such as an alternate prefix"
42         @echo "      into which to install), call ./configure explicitly and then make again."
43         @echo "      See \"./configure --help\" for more details."
44         @echo ""
45         ./configure
46
47 include Makefile.config
48
49 include lib/Makefile.local
50 include compat/Makefile.local
51 include emacs/Makefile.local
52 include Makefile.local
53
54 # The user has not set any verbosity, default to quiet mode and inform the
55 # user how to enable verbose compiles.
56 ifeq ($(V),)
57 quiet_DOC := "Use \"$(MAKE) V=1\" to see the verbose compile lines.\n"
58 quiet = @printf $(quiet_DOC)$(eval quiet_DOC:=)"  $1 $2 $@\n"; $($1)
59 endif
60 # The user has explicitly enabled quiet compilation.
61 ifeq ($(V),0)
62 quiet = @printf "  $1   $@\n"; $($1)
63 endif
64 # Otherwise, print the full command line.
65 quiet ?= $($1)
66
67 %.o: %.cc $(global_deps)
68         $(call quiet,CXX,$(CXXFLAGS)) -c $(FINAL_CXXFLAGS) $< -o $@
69
70 %.o: %.c $(global_deps)
71         $(call quiet,CC,$(CFLAGS)) -c $(FINAL_CFLAGS) $< -o $@
72
73 %.elc: %.el
74         $(call quiet,EMACS) -batch -f batch-byte-compile $<
75
76 .deps/%.d: %.c $(global_deps)
77         @set -e; rm -f $@; mkdir -p $$(dirname $@) ; \
78         $(CC) -M $(CPPFLAGS) $(FINAL_CFLAGS) $< > $@.$$$$ 2>/dev/null ; \
79         sed 's,'$$(basename $*)'\.o[ :]*,$*.o $@ : ,g' < $@.$$$$ > $@; \
80         rm -f $@.$$$$
81
82 .deps/%.d: %.cc $(global_deps)
83         @set -e; rm -f $@; mkdir -p $$(dirname $@) ; \
84         $(CXX) -M $(CPPFLAGS) $(FINAL_CXXFLAGS) $< > $@.$$$$ 2>/dev/null ; \
85         sed 's,'$$(basename $*)'\.o[ :]*,$*.o $@ : ,g' < $@.$$$$ > $@; \
86         rm -f $@.$$$$
87
88 DEPS := $(SRCS:%.c=.deps/%.d)
89 DEPS := $(DEPS:%.cc=.deps/%.d)
90 -include $(DEPS)
91
92 .PHONY : clean
93 clean:
94         rm -f $(CLEAN); rm -rf .deps