From: Ken Raeburn Date: Sat, 1 Sep 2001 04:06:44 +0000 (+0000) Subject: * post.in (.depend): Refuse to do anything if srcdir is ".". Find a shortcut X-Git-Tag: krb5-1.3-alpha1~1100 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=0dd83f2cad522db21affaaadc0c97e0d7e2ffa93;p=krb5.git * 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. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13718 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/config/ChangeLog b/src/config/ChangeLog index 1471def05..beb6138fc 100644 --- a/src/config/ChangeLog +++ b/src/config/ChangeLog @@ -1,3 +1,10 @@ +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. + 2001-08-07 Ezra Peisach * post.in (all-recurse clean-recurse distclean-recurse diff --git a/src/config/post.in b/src/config/post.in index e0ea7213d..9e27de820 100644 --- a/src/config/post.in +++ b/src/config/post.in @@ -3,13 +3,25 @@ check-windows:: .depend: $(SRCS) $(SRCTOP)/util/depfix.sed + 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 -f $(SRCTOP)/util/depfix.sed | \ - sed -e 's; $(SRCTOP)/; $$(SRCTOP)/;g' | \ - sed -e 's; $(srcdir)/; $$(srcdir)/;g' | \ - sed -e 's; $(BUILDTOP)/; $$(BUILDTOP)/;g' | \ - sed -e 's; \./; ;g' > .depend; \ + sed -e 's; \./; ;g' \ + -e "s; $$r/"'; $$(SRCTOP)/;g' \ + -e 's; $(SRCTOP)/; $$(SRCTOP)/;g' \ + -e 's; $(srcdir)/; $$(srcdir)/;g' \ + -e 's; $(BUILDTOP)/; $$(BUILDTOP)/;g' | \ + sed -f $(SRCTOP)/util/depfix.sed \ + > .depend; \ else :; fi depend:: .depend