* [PATCH] Makefile: Make object targets depend on Makefiles
@ 2009-11-19 0:37 Jan Janak
2009-11-20 12:44 ` Carl Worth
0 siblings, 1 reply; 2+ messages in thread
From: Jan Janak @ 2009-11-19 0:37 UTC (permalink / raw)
To: notmuch
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-11-20 12:44 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-19 0:37 [PATCH] Makefile: Make object targets depend on Makefiles Jan Janak
2009-11-20 12:44 ` Carl Worth
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).