summaryrefslogtreecommitdiff
path: root/i386
diff options
context:
space:
mode:
authorThomas Bushnell <thomas@gnu.org>1999-07-02 02:33:31 +0000
committerThomas Bushnell <thomas@gnu.org>1999-07-02 02:33:31 +0000
commit5de2e50891f0406244f4dcb7af009dce6213a0ea (patch)
tree2a55338d39cdc6e5cac71aefe56ec15c9f584b75 /i386
parent9b4552a22d3abb08bb25f4e0035b164fce358d99 (diff)
1999-07-01 Thomas Bushnell, BSG <tb@mit.edu>
* i386/linux/Makefile.in: For each .o file in $(linux-objs) include a corresponding .d file, unless `no_deps' is `t'. (make-deps): New function. (%.d): New pattern rules for building %.d from %.c and %.S.
Diffstat (limited to 'i386')
-rw-r--r--i386/linux/Makefile.in25
1 files changed, 25 insertions, 0 deletions
diff --git a/i386/linux/Makefile.in b/i386/linux/Makefile.in
index cdcabb3..80d008d 100644
--- a/i386/linux/Makefile.in
+++ b/i386/linux/Makefile.in
@@ -205,3 +205,28 @@ mostlyclean: distclean
maintainer-clean: mostlyclean
rm -f $(srcdir)/configure
+
+
+
+#
+# Dependency generation
+#
+
+# Include dependency files
+ifneq ($(no_deps),t)
+
+# For each .o file we need a .d file.
+-include $(subst .o,.d,$(filter %.o,$(linux-objs))) /dev/null
+
+endif
+
+# Generic rule for $(CC) based compilation for making dependencies
+define make-deps
+set -e; $(CC) $(CFLAGS) $(CPPFLAGS) -M -MG $< | \
+ sed > $@.new -e 's/$*\.o:/$*.o $@:/'
+mv -f $@.new $@
+endef
+
+%.d: %.c $(before-compile); $(make-deps)
+%.d: %.S $(before-compile); $(make-deps)
+