unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Jan Janak <jan@ryngle.com>
To: notmuch@notmuchmail.org
Subject: [PATCH] Makefile: Make object targets depend on Makefiles
Date: Thu, 19 Nov 2009 01:37:25 +0100	[thread overview]
Message-ID: <1258591045-16494-1-git-send-email-jan@ryngle.com> (raw)

All objects need to be recompiled when any of the Makefiles changes, so
we make them all depend on all the Makefiles.

Signed-off-by: Jan Janak <jan@ryngle.com>
---
 Makefile |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile
index 96aaa73..2787aff 100644
--- a/Makefile
+++ b/Makefile
@@ -7,6 +7,9 @@ CFLAGS=-O2
 extra_cflags = `pkg-config --cflags glib-2.0 gmime-2.4 talloc`
 extra_cxxflags = `xapian-config --cxxflags`
 
+all_deps = Makefile Makefile.local Makefile.config \
+		   lib/Makefile lib/Makefile.local
+
 # Now smash together user's values with our extra values
 override CFLAGS += $(WARN_FLAGS) $(extra_cflags)
 override CXXFLAGS += $(WARN_FLAGS) $(extra_cflags) $(extra_cxxflags)
@@ -21,19 +24,19 @@ include lib/Makefile.local
 # And get user settings from the output of configure
 include Makefile.config
 
-%.o: %.cc
+%.o: %.cc $(all_deps)
 	$(CXX) -c $(CFLAGS) $(CXXFLAGS) $< -o $@
 
-%.o: %.c
+%.o: %.c $(all_deps)
 	$(CC) -c $(CFLAGS) $< -o $@
 
-.deps/%.d: %.c
+.deps/%.d: %.c $(all_deps)
 	@set -e; rm -f $@; mkdir -p $$(dirname $@) ; \
 	$(CC) -M $(CPPFLAGS) $(CFLAGS) $< > $@.$$$$; \
 	sed 's,'$$(basename $*)'\.o[ :]*,$*.o $@ : ,g' < $@.$$$$ > $@; \
 	rm -f $@.$$$$
 
-.deps/%.d: %.cc
+.deps/%.d: %.cc $(all_deps)
 	@set -e; rm -f $@; mkdir -p $$(dirname $@) ; \
 	$(CXX) -M $(CPPFLAGS) $(CXXFLAGS) $< > $@.$$$$; \
 	sed 's,'$$(basename $*)'\.o[ :]*,$*.o $@ : ,g' < $@.$$$$ > $@; \
-- 
1.6.3.3

             reply	other threads:[~2009-11-19  0:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-19  0:37 Jan Janak [this message]
2009-11-20 12:44 ` [PATCH] Makefile: Make object targets depend on Makefiles Carl Worth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1258591045-16494-1-git-send-email-jan@ryngle.com \
    --to=jan@ryngle.com \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).