summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1996-04-28 23:02:54 +0000
committerRoland McGrath <roland@gnu.org>1996-04-28 23:02:54 +0000
commit922a82516a8364e31511e73b48ece5cc9c6aed46 (patch)
tree0ab70431aa88f23d9d793a258273476583daa0a2
parent328500869ca823e16d4b09a718547e9e57b77bc6 (diff)
(make-deps): New canned sequence. Remove gcc-lib hdrs from deps.
Use atomic mv for output. (%.d: %.c, %.d: %.S): Use $(make-deps).
-rw-r--r--Makeconf24
1 files changed, 10 insertions, 14 deletions
diff --git a/Makeconf b/Makeconf
index 6f57d335..73c8b484 100644
--- a/Makeconf
+++ b/Makeconf
@@ -313,26 +313,22 @@ endif
%.miguh_d: %.migu_d
sed -e 's/User\.c/_U\.h/' -e 's/migu_d/miguh_d/' < $< > $@
-# Here is how to make .d files from .c files
-ifeq ($(makemode),library)
-%.d: %.c
- (set -e; $(CC) $(CFLAGS) $(CPPFLAGS) -M -MG $< | \
- sed -e 's/$*\.o:/$*.o $*_pic.o $@:/' > $@)
-else
-%.d: %.c
- (set -e; $(CC) $(CFLAGS) $(CPPFLAGS) -M -MG $< | \
- sed -e 's/$*\.o:/$*.o $@:/' > $@)
-endif
+define make-deps
+set -e; $(CC) $(CFLAGS) $(CPPFLAGS) -M -MG $< | \
+sed > $@.new -e 's/$*\.o:/$*.o $*_pic.o $@:/' \
+ -e 's% [^ ]*/gcc-lib/[^ ]*\.h%%g'
+mv -f $@.new $@
+endef
+# Here is how to make .d files from .c files
+%.d: %.c; $(make-deps)
# Here is how to make .d files from .S files
-%.d: %.S
- (set -e; $(CC) $(CFLAGS) $(CPPFLAGS) -M -MG $< | \
- sed -e 's/*\.o:/$*.o $@:/' > $@)
+%.d: %.S; $(make-deps)
# .s files don't go through the preprocessor, so we do this
# This rule must come *after* the genuine ones above, so that
# make doesn't build a .s file and then make an empty dependency
# list.
%.d: %.s
- echo '$*.o: $*.s' > $*.d
+ echo '$*.o: $<' > $@