]> git.notmuchmail.org Git - notmuch/commitdiff
Move some variable assignments from Makefile.local to Makefile.config
authorCarl Worth <cworth@cworth.org>
Thu, 1 Apr 2010 05:29:16 +0000 (22:29 -0700)
committerCarl Worth <cworth@cworth.org>
Thu, 1 Apr 2010 05:54:08 +0000 (22:54 -0700)
There's not any special configure logic for determining these variable
values, but if we did add some in the future, then these will now be
in the right place for that.

Additionally, this now makes Makefile.local the single place for the
user to look for manually tweaking a variable assignment, (say, for a
compiler that can't accept a particular warning argument).

With this change, there should rarely be any need for a user to poke
into any Makefile.local file.

Makefile.local
configure

index d7cc9edc2c4662d8beb6a2cac15dd4cf185e1ab1..aa822f6aae26d8d8fbadc3e7465644f11d03a9e6 100644 (file)
@@ -12,10 +12,6 @@ Makefile.config: configure
        @echo ""
        ./configure
 
-SONAME = libnotmuch.so.1
-WARN_CXXFLAGS=-Wall -Wextra -Wwrite-strings -Wswitch-enum
-WARN_CFLAGS=$(WARN_CXXFLAGS) -Wmissing-declarations
-
 # Sub-directory Makefile.local fragments can append to these variables
 # to have directory-specific cflags as necessary.
 extra_cflags :=
@@ -26,15 +22,6 @@ FINAL_CFLAGS = $(CFLAGS) $(WARN_CFLAGS) $(CONFIGURE_CFLAGS) $(extra_cflags)
 FINAL_CXXFLAGS = $(CXXFLAGS) $(WARN_CXXFLAGS) $(CONFIGURE_CXXFLAGS) $(extra_cflags) $(extra_cxxflags)
 FINAL_LDFLAGS = $(LDFLAGS) $(CONFIGURE_LDFLAGS)
 
-# Additional programs that are used during the compilation process.
-EMACS ?= emacs --quick
-# Lowercase to avoid clash with GZIP environment variable for passing
-# arguments to gzip.
-gzip = gzip
-
-bash_completion_dir = /etc/bash_completion.d
-zsh_completion_dir = /usr/share/zsh/functions/Completion/Unix
-
 all: notmuch notmuch.1.gz
 ifeq ($(MAKECMDGOALS),)
        @echo ""
@@ -117,6 +104,8 @@ notmuch: $(notmuch_client_modules) lib/libnotmuch.so
 notmuch.1.gz: notmuch.1
        $(call quiet,gzip) --stdout $^ > $@
 
+SONAME = libnotmuch.so.1
+
 install: all notmuch.1.gz
        for d in $(DESTDIR)$(prefix)/bin/ $(DESTDIR)$(libdir)/ \
                $(DESTDIR)$(prefix)/include/ $(DESTDIR)$(prefix)/share/man/man1 ; \
index 5d254b3d97c09ab8ee047f4cd0b3719c3258909b..64038f87aededde4c44448fe9e303dbba151d97f 100755 (executable)
--- a/configure
+++ b/configure
@@ -8,6 +8,13 @@ CFLAGS=${CFLAGS:--O2}
 CXXFLAGS=${CXXFLAGS:-\$(CFLAGS)}
 XAPIAN_CONFIG=${XAPIAN_CONFIG:-xapian-config-1.1 xapian-config}
 
+# We don't allow the EMACS or GZIP Makefile variables inherit values
+# from the environment as we do with CC and CXX above. The reason is
+# that these names as environment variables have existing uses other
+# than the program name that we want. (EMACS is set to 't' when a
+# shell is running within emacs and GZIP specifies arguments to pass
+# on the gzip command line).
+
 # Set the defaults for values the user can specify with command-line
 # options.
 PREFIX=/usr/local
@@ -269,12 +276,24 @@ CC = ${CC}
 # The C++ compiler to use
 CXX = ${CXX}
 
+# Command to execute emacs from Makefiles
+EMACS = emacs --quick
+
+# Command to execute gzip from Makefiles
+gzip = gzip
+
 # Default FLAGS for C compiler (can be overridden by user such as "make CFLAGS=-g")
 CFLAGS = ${CFLAGS}
 
 # Default FLAGS for C++ compiler (can be overridden by user such as "make CXXFLAGS=-g")
 CXXFLAGS = ${CXXFLAGS}
 
+# Flags to enable warnings when using the C++ compiler
+WARN_CXXFLAGS=-Wall -Wextra -Wwrite-strings -Wswitch-enum
+
+# Flags to enable warnings when using the C compiler
+WARN_CFLAGS=\$(WARN_CXXFLAGS) -Wmissing-declarations
+
 # The prefix to which notmuch should be installed
 prefix = ${PREFIX}
 
@@ -287,6 +306,12 @@ emacs_lispdir=${emacs_lispdir}
 # The directory to which desktop files should be installed
 desktop_dir = \${prefix}/share/applications
 
+# The directory to which bash completions files should be installed
+bash_completion_dir = /etc/bash_completion.d
+
+# The directory to which zsh completions files should be installed
+zsh_completion_dir = ${PREFIX}/share/zsh/functions/Completion/Unix
+
 # Whether the getline function is available (if not, then notmuch will
 # build its own version)
 HAVE_GETLINE = ${have_getline}