* post.in: Run compiler and sed in separate rules. Make "depend" a recursive
authorKen Raeburn <raeburn@mit.edu>
Sat, 1 Sep 2001 23:49:30 +0000 (23:49 +0000)
committerKen Raeburn <raeburn@mit.edu>
Sat, 1 Sep 2001 23:49:30 +0000 (23:49 +0000)
target.  Check for error from compiler invocation.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13723 dc483132-0cff-0310-8789-dd5450dbe970

src/config/ChangeLog
src/config/post.in

index beb6138fcfa797fc3fbaecb6319d04bd273e04fd..cb813492ec48ec8b0d4c4d0012bb8ca2e9611bd1 100644 (file)
@@ -1,9 +1,13 @@
 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>
 
index 666aee85c3cf258732be9fbbf1b5e03802297558..8754dd9db03618cba38e5e6a770728ab1fb78847 100644 (file)
@@ -2,29 +2,36 @@
 
 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 \
@@ -33,6 +40,9 @@ depend:: .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::
@@ -63,7 +73,7 @@ $(srcdir)/$(thisconfigdir)/configure: $(srcdir)/$(thisconfigdir)/configure.in \
        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 \