From b4c3d53a6e88ea597a165289fd858b36aba03215 Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Thu, 30 Dec 2004 22:05:12 +0000 Subject: Do the target object file name hacking in "make depend" earlier, before the line breaks are recomputed, instead of after. This will result in lots of whitespace changes in dependencies in directories that build library object files, but the final output is nicer (fewer long lines), and running "make depend" uses one fewer invocation of sed (balancing out the extra one I added in another checkin earlier today). * config/post.in (.depend): Don't do target name munging here. (.depfix2.sed): Pass extra value $(STLIBOBJS). * util/depfix.sed: Don't change foo.o to $(OUTPRE)foo.$(OBJEXT) here. * util/depgen.sed: Add new argument for STLIBOBJS. Do the OUTPRE/OBJEXT substitution here, and if STLIBOBJS is non-empty, add foo.so and foo.po while we're at it. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16986 dc483132-0cff-0310-8789-dd5450dbe970 --- src/config/ChangeLog | 4 +++- src/config/post.in | 5 +---- src/util/ChangeLog | 7 +++++++ src/util/depfix.sed | 3 --- src/util/depgen.sed | 25 ++++++++++++++++++++++--- 5 files changed, 33 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/config/ChangeLog b/src/config/ChangeLog index c799b1f..21ecafe 100644 --- a/src/config/ChangeLog +++ b/src/config/ChangeLog @@ -1,9 +1,11 @@ 2004-12-30 Ken Raeburn - * post.in (.depend): Delete blank lines in generated file. + * post.in (.depend): Delete blank lines in generated file. Don't + do target name munging here. (DEP_CFG_VERIFY, DEP_VERIFY, depend-verify-*, .depend-verify-*, .depfix2.sed): Move all the flag files to $(BUILDTOP) so there'll be only one of each. + (.depfix2.sed): Pass extra value $(STLIBOBJS). 2004-12-17 Jeffrey Altman diff --git a/src/config/post.in b/src/config/post.in index dd34e17..6a96c92 100644 --- a/src/config/post.in +++ b/src/config/post.in @@ -92,17 +92,14 @@ depend-dependencies: # make variables happen in depfix.sed. .depfix2.sed: $(BUILDTOP)/.depend-verify-gcc Makefile $(SRCTOP)/util/depgen.sed x=`$(CC) -print-libgcc-file-name` ; \ - echo '$(SRCTOP)' '$(myfulldir)' '$(srcdir)' '$(BUILDTOP)' "$$x" | sed -f $(SRCTOP)/util/depgen.sed > .depfix2.tmp + echo '$(SRCTOP)' '$(myfulldir)' '$(srcdir)' '$(BUILDTOP)' "$$x" '$(STLIBOBJS)' | sed -f $(SRCTOP)/util/depgen.sed > .depfix2.tmp mv -f .depfix2.tmp .depfix2.sed -DEPLIBOBJNAMEFIX = sed -e 's;^\$$(OUTPRE)\([a-zA-Z0-9_\-]*\)\.\$$(OBJEXT):;\1.so \1.po &;' - # NOTE: This will also generate spurious $(OUTPRE) and $(OBJEXT) # references in rules for non-library objects in a directory where # library objects happen to be built. It's mostly harmless. .depend: .d .depfix2.sed $(SRCTOP)/util/depfix.sed sed -f .depfix2.sed < .d | sed -f $(SRCTOP)/util/depfix.sed | \ - (if test "x$(STLIBOBJS)" != "x"; then $(DEPLIBOBJNAMEFIX) ; else cat; fi ) | \ sed -e '/^$$/d' > .depend depend-update-makefile: .depend depend-recurse diff --git a/src/util/ChangeLog b/src/util/ChangeLog index 5e792c8..0ecbec2 100644 --- a/src/util/ChangeLog +++ b/src/util/ChangeLog @@ -1,3 +1,10 @@ +2004-12-30 Ken Raeburn + + * depfix.sed: Don't change foo.o to $(OUTPRE)foo.$(OBJEXT) here. + * depgen.sed: Add new argument for STLIBOBJS. + Do the OUTPRE/OBJEXT substitution here, and if STLIBOBJS is + non-empty, add foo.so and foo.po while we're at it. + 2004-12-21 Tom Yu * def-check.pl: Check for PRIVATE or INTERNAL annotations in defs diff --git a/src/util/depfix.sed b/src/util/depfix.sed index 7207065..1db3b0c 100644 --- a/src/util/depfix.sed +++ b/src/util/depfix.sed @@ -24,9 +24,6 @@ bFIRST s/$/ / s/ */ /g -# change foo.o -> $(OUTPRE)foo.$(OBJEXT) -s;^\([a-zA-Z0-9_\-]*\).o:;$(OUTPRE)\1.$(OBJEXT):; - # delete tcl-specific headers s;/[^ ]*/tcl\.h ;;g s;/[^ ]*/tclDecls\.h ;;g diff --git a/src/util/depgen.sed b/src/util/depgen.sed index 3d31db9..370ff53 100644 --- a/src/util/depgen.sed +++ b/src/util/depgen.sed @@ -1,4 +1,4 @@ -# input srctop myfulldir srcdir buildtop libgccfilename +# input srctop myfulldir srcdir buildtop libgccfilename stlibobjs # something like ../../../../asrc/lib/krb5/asn.1/../../../ lib/krb5/asn.1 # # output a sequence of sed commands for recognizing and replacing srctop, @@ -18,11 +18,13 @@ # seems to omit some of the earlier intended output. I think we're # always doing the substitutions anyways, so always printing should be # fine. +# +# STLIBOBJS will usually be empty, or include spaces. # Output some mostly-fixed patterns first h -s|^\([^ ]*\) \([^ ]*\) \([^ ]*\) \([^ ]*\) \([^ ]*\)$|# This file is automatically generated by depgen.sed, do not edit it.\ +s|^\([^ ]*\) \([^ ]*\) \([^ ]*\) \([^ ]*\) \([^ ]*\) \(.*\)$|# This file is automatically generated by depgen.sed, do not edit it.\ #\ # Parameters used to generate this instance:\ #\ @@ -31,14 +33,31 @@ s|^\([^ ]*\) \([^ ]*\) \([^ ]*\) \([^ ]*\) \([^ ]*\)$|# This file is automatical # srcdir = \3\ # BUILDTOP = \4\ # libgcc file name = \5\ +# STLIBOBJS = \6\ #\ \ # First, remove redundant leading "//" and "./" ...\ s;///*;/;g\ -s; \\./; ;g| +s; \\./; ;g\ +\ +# change foo.o -> $(OUTPRE)foo.$(OBJEXT)\ +s;^\\([a-zA-Z0-9_\\-]*\\).o:;$(OUTPRE)\\1.$(OBJEXT):;| +p +x + +# If the STLIBOBJS argument is not empty, emit a pattern to +# change the target name into $(OUTPRE)foo.$(OBJEXT) foo.so foo.po. +h +s|^[^ ]* [^ ]* [^ ]* [^ ]* [^ ]* || +s|^..*$|\ +# Fix up target name for the various different objects we might build.\ +s;^\\\$(OUTPRE)\\([a-zA-Z0-9_\\-]*\\)\\.\\\$(OBJEXT):;\\1.so \\1.po \&;| p x +# Now throw away STLIBOBJS, we don't need it any more. +s|^\([^ ]* [^ ]* [^ ]* [^ ]* [^ ]*\) .*$|\1| + h s|^[^ ]* [^ ]* [^ ]* [^ ]* || s|libgcc\.[^ ]*$|include| -- cgit v1.1