From 5de2e50891f0406244f4dcb7af009dce6213a0ea Mon Sep 17 00:00:00 2001 From: Thomas Bushnell Date: Fri, 2 Jul 1999 02:33:31 +0000 Subject: 1999-07-01 Thomas Bushnell, BSG * 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. --- i386/linux/Makefile.in | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'i386/linux/Makefile.in') 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) + -- cgit v1.2.3