From ae23083d7ba6fc7113469e72d5fa25ed5c34d9db Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Sat, 1 Sep 2001 23:49:30 +0000 Subject: [PATCH] * post.in: Run compiler and sed in separate rules. Make "depend" a recursive 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 | 12 ++++++++---- src/config/post.in | 44 +++++++++++++++++++++++++++----------------- 2 files changed, 35 insertions(+), 21 deletions(-) diff --git a/src/config/ChangeLog b/src/config/ChangeLog index beb6138fc..cb813492e 100644 --- a/src/config/ChangeLog +++ b/src/config/ChangeLog @@ -1,9 +1,13 @@ 2001-09-01 Ken Raeburn - * 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 diff --git a/src/config/post.in b/src/config/post.in index 666aee85c..8754dd9db 100644 --- a/src/config/post.in +++ b/src/config/post.in @@ -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 \ -- 2.26.2