]> git.notmuchmail.org Git - notmuch/commitdiff
Makefile: Fix Makefiles to depend on all child Makefile fragments.
authorCarl Worth <cworth@cworth.org>
Wed, 10 Mar 2010 18:59:57 +0000 (10:59 -0800)
committerCarl Worth <cworth@cworth.org>
Wed, 10 Mar 2010 18:59:57 +0000 (10:59 -0800)
We were previously maintaining two lists of the child Makefile
fragments---one for the includes and another for the dependencies. So,
of course, they drifted and the dependency list wasn't up to date.

We fix this by adding a single subdirs variable, and then using GNU
Makefile substitution to generate both the include and the dependency
lists.

Some side effect of this change caused the '=' assignment of the dir
variable to not work anymore. I'm not sure why that is, but using ':='
makes sense here and fixes the problem.

Makefile
compat/Makefile.local
emacs/Makefile.local
lib/Makefile.local

index 7a59ce0ade5dbebc997aa0b92570c36722768493..46f001ce2fa5d2523ff08c577b4aadbecae853fa 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -10,9 +10,6 @@ gzip = gzip
 bash_completion_dir = /etc/bash_completion.d
 zsh_completion_dir = /usr/share/zsh/functions/Completion/Unix
 
 bash_completion_dir = /etc/bash_completion.d
 zsh_completion_dir = /usr/share/zsh/functions/Completion/Unix
 
-global_deps = Makefile Makefile.local Makefile.config \
-                  lib/Makefile lib/Makefile.local
-
 extra_cflags :=
 extra_cxxflags :=
 
 extra_cflags :=
 extra_cxxflags :=
 
@@ -44,12 +41,12 @@ Makefile.config: configure
        @echo ""
        ./configure
 
        @echo ""
        ./configure
 
-include Makefile.config
+subdirs = compat emacs lib
+
+global_deps = Makefile Makefile.config Makefile.local \
+       $(subdirs:%=%/Makefile) $(subdirs:%=%/Makefile.local)
 
 
-include lib/Makefile.local
-include compat/Makefile.local
-include emacs/Makefile.local
-include Makefile.local
+include Makefile.config Makefile.local $(subdirs:%=%/Makefile.local)
 
 # The user has not set any verbosity, default to quiet mode and inform the
 # user how to enable verbose compiles.
 
 # The user has not set any verbosity, default to quiet mode and inform the
 # user how to enable verbose compiles.
index ccc59aefdf2517e1db94ca91c7ac0c55a23111d5..17b451402fbc065c7af2c0c0577f5de9ae6a4504 100644 (file)
@@ -1,4 +1,4 @@
-dir=compat
+dir := compat
 extra_cflags += -I$(dir)
 
 notmuch_compat_srcs =
 extra_cflags += -I$(dir)
 
 notmuch_compat_srcs =
index b895d11a9d6978ae8ba75485f9e25efbeaddd6ff..17ede8635e053326e51c83dd3ac83ab6433c73a1 100644 (file)
@@ -1,8 +1,7 @@
-dir=emacs
-emacs_sources=                 \
-       $(dir)/notmuch.el
+dir := emacs
+emacs_sources := $(dir)/notmuch.el
 
 
-emacs_bytecode=$(subst .el,.elc,$(emacs_sources))
+emacs_bytecode := $(subst .el,.elc,$(emacs_sources))
 
 emacs: $(emacs_bytecode)
 
 
 emacs: $(emacs_bytecode)
 
index 70489e17207b13c8dad862ff63221277cf65a191..495b27e06eebd225fdf3958d219103e6ac2cd208 100644 (file)
@@ -1,4 +1,4 @@
-dir=lib
+dir := lib
 extra_cflags += -I$(dir)
 
 libnotmuch_c_srcs =            \
 extra_cflags += -I$(dir)
 
 libnotmuch_c_srcs =            \