* post.in (depfix2.sed): New target, generates a sed script that'll do a better
authorKen Raeburn <raeburn@mit.edu>
Thu, 6 Sep 2001 09:43:33 +0000 (09:43 +0000)
committerKen Raeburn <raeburn@mit.edu>
Thu, 6 Sep 2001 09:43:33 +0000 (09:43 +0000)
job of identifying possible $(SRCTOP) uses.
(.depend): Use it.

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

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

index cb813492ec48ec8b0d4c4d0012bb8ca2e9611bd1..d850e593f6604c4ecc26f1a7249b4fd6c67c75ff 100644 (file)
@@ -1,3 +1,9 @@
+2001-09-06  Ken Raeburn  <raeburn@mit.edu>
+
+       * post.in (depfix2.sed): New target, generates a sed script
+       that'll do a better job of identifying possible $(SRCTOP) uses.
+       (.depend): Use it.
+
 2001-09-01  Ken Raeburn  <raeburn@mit.edu>
 
        * post.in (.d): Run compiler as a separate target from sed
index 8754dd9db03618cba38e5e6a770728ab1fb78847..370162b13558e2c3b26a399a7d3a91fbcc606440 100644 (file)
@@ -15,21 +15,20 @@ check-windows::
                touch .d ; \
        fi
 
-.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
+# Generate a script for dropping in the appropriate make variables, using
+# directory-specific parameters.  General substitutions independent of local
+# make variables happen in depfix.sed.
+depfix2.sed: Makefile $(SRCTOP)/util/depgen.sed
+       echo 's; \./; ;g'                               >> depfix2.tmp
+       echo 's; $(SRCTOP)/; $$(SRCTOP)/;g'             >> depfix2.tmp
+       echo 's; $(srcdir)/; $$(srcdir)/;g'             >> depfix2.tmp
+       echo 's; $$(srcdir)/\.\./; $(srcdir)/../;g'     >> depfix2.tmp
+       echo '$(SRCTOP)' | sed -f $(SRCTOP)/util/depgen.sed >> depfix2.tmp
+       echo 's; $(BUILDTOP)/; $$(BUILDTOP)/;g'         >> depfix2.tmp
+       mv -f depfix2.tmp depfix2.sed
+
+.depend: .d depfix2.sed $(SRCTOP)/util/depfix.sed
+       sed -f depfix2.sed < .d | sed -f $(SRCTOP)/util/depfix.sed > .depend
 
 depend-postrecurse:: .depend
        if test -n "$(SRCS)" ; then \