2001-09-01 Ken Raeburn <raeburn@mit.edu>
- * post.in (.depend): Refuse to do anything if srcdir is ".". Find
- a shortcut name for SRCTOP to eliminate "foo/.." subsequences, in
- case the compiler does the same. Run depfix.sed after the
- directory-specific substitutions, not before.
+ * post.in (.d): Run compiler as a separate target from sed
+ processing. Refuse to do anything if srcdir is ".".
+ (.depend): Find a shortcut name for SRCTOP to eliminate "foo/.."
+ subsequences, in case the compiler does the same. Run depfix.sed
+ after the directory-specific substitutions, not before.
+ (depend-postrecurse): Renamed from old "depend" target.
+ (depend, depend-prerecurse, depend-recurse): Make "depend"
+ processing recursive.
2001-08-07 Ezra Peisach <epeisach@mit.edu>
check-windows::
-.depend: $(SRCS) $(SRCTOP)/util/depfix.sed
+.d: $(SRCS)
if test "$(srcdir)" = "." ; then \
echo 1>&2 error: cannot build dependencies with srcdir=. ; \
echo 1>&2 "(can't distinguish generated files from source files)" ; \
exit 1 ; \
fi
if test -n "$(SRCS)" ; then \
- r="$(SRCTOP)" ; oldr=hello ; \
- while test "$$r" != "$$oldr" ; do \
- oldr="$$r" ; \
- r=`echo "$$oldr" | sed -e 's;/[a-z][a-z0-9_\-]*/../;/;g' -e 's;/[a-z][a-z0-9_\-]*/..$$;;g'` ; \
- done ; \
- $(CC) -M $(ALL_CFLAGS) $(SRCS) | \
- sed -e 's; \./; ;g' \
- -e 's; $(SRCTOP)/; $$(SRCTOP)/;g' \
- -e 's; $(srcdir)/; $$(srcdir)/;g' \
- -e "s; $$r/"'; $$(SRCTOP)/;g' \
- -e 's; $(BUILDTOP)/; $$(BUILDTOP)/;g' | \
- sed -f $(SRCTOP)/util/depfix.sed \
- > .depend; \
- else :; fi
+ $(CC) -M $(ALL_CFLAGS) $(SRCS) > .dtmp || exit 1 ; \
+ mv -f .dtmp .d ; \
+ else \
+ touch .d ; \
+ fi
-depend:: .depend
+.depend: .d $(SRCTOP)/util/depfix.sed
+ r=`echo "$(SRCTOP)" | sed \
+ -e ':loop' \
+ -e '\;/[a-z][a-z0-9_\-]*/\.\./;{' \
+ -e 's;/[a-z][a-z0-9_\-]*/\.\./;/;g' \
+ -e 'bloop' \
+ -e '}' \
+ -e 's;/[a-z][a-z0-9_\-]*/\.\.$$;;g'` ; \
+ sed < .d \
+ -e 's; \./; ;g' \
+ -e 's; $(SRCTOP)/; $$(SRCTOP)/;g' \
+ -e 's; $(srcdir)/; $$(srcdir)/;g' \
+ -e "s; $$r/"'; $$(SRCTOP)/;g' \
+ -e 's; $(BUILDTOP)/; $$(BUILDTOP)/;g' | \
+ sed -f $(SRCTOP)/util/depfix.sed > .depend
+
+depend-postrecurse:: .depend
if test -n "$(SRCS)" ; then \
sed -e '/^# +++ Dependency line eater +++/,$$d' \
< $(srcdir)/Makefile.in | cat - .depend \
$(MV) $(srcdir)/Makefile.in.new $(srcdir)/Makefile.in; \
else :; fi
+depend:: depend-prerecurse depend-recurse depend-postrecurse
+depend-prerecurse::
+
clean:: clean-$(WHAT)
clean-unix::
cd $(srcdir)/$(thisconfigdir) && \
$(AUTOCONF) --localdir=$(CONFIG_RELTOPDIR) $(AUTOCONFFLAGS)
-all-recurse clean-recurse distclean-recurse install-recurse check-recurse Makefiles-recurse:
+all-recurse clean-recurse distclean-recurse install-recurse check-recurse depend-recurse Makefiles-recurse:
@case "`echo 'x$(MFLAGS)'|sed -e 's/^x//' -e 's/ --.*$$//'`" \
in *[ik]*) e="status=1" ;; *) e="exit 1";; esac; \
if test -z "$(MY_SUBDIRS)" ; then \