From 604648724c46bd9d18868849197b3b3ca68bf232 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Wed, 21 Feb 1996 05:55:47 +0000 Subject: [PATCH] Bug fix --- ChangeLog | 4 ++++ depend.am | 6 ++++-- lib/am/depend.am | 6 ++++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index a85b1d76..206bfc86 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Tue Feb 20 17:25:18 1996 Tom Tromey + + * depend.am ($(srcdir)/.deps/%.P): Regexp fix. + Mon Feb 19 09:53:09 1996 Tom Tromey * remake.am ($(srcdir)/Makefile.in): Depend on configure.in. diff --git a/depend.am b/depend.am index f4847416..375c5590 100644 --- a/depend.am +++ b/depend.am @@ -44,8 +44,10 @@ $(srcdir)/.deps/%.P: $(srcdir)/%.c ## Use funny regexp because otherwise too much can be matched when ## srcdir begins with ".". Can't use \< since sed doesn't recognize ## "." as a word start. Regexp-quote srcdir because "." is a matching -## operator which commonly appears in filenames. - @re=`echo 's,^$(srcdir)/*,,g;s, $(srcdir)/*, ,g' | sed 's,\.,\\\\.,g'`; \ +## operator which commonly appears in filenames. Need "//*" in +## regexps because otherwise the regexp will fail when srcdir=. and +## the path to the file is relative (eg ../lib/error.c matches "./*"). + @re=`echo 's,^$(srcdir)//*,,g;s, $(srcdir)//*, ,g' | sed 's,\.,\\\\.,g'`; \ $(MKDEP) $< | sed "$$re" > $@-tmp @if test -n "$o"; then \ sed 's/\.o:/$$o:/' $@-tmp > $@; \ diff --git a/lib/am/depend.am b/lib/am/depend.am index f4847416..375c5590 100644 --- a/lib/am/depend.am +++ b/lib/am/depend.am @@ -44,8 +44,10 @@ $(srcdir)/.deps/%.P: $(srcdir)/%.c ## Use funny regexp because otherwise too much can be matched when ## srcdir begins with ".". Can't use \< since sed doesn't recognize ## "." as a word start. Regexp-quote srcdir because "." is a matching -## operator which commonly appears in filenames. - @re=`echo 's,^$(srcdir)/*,,g;s, $(srcdir)/*, ,g' | sed 's,\.,\\\\.,g'`; \ +## operator which commonly appears in filenames. Need "//*" in +## regexps because otherwise the regexp will fail when srcdir=. and +## the path to the file is relative (eg ../lib/error.c matches "./*"). + @re=`echo 's,^$(srcdir)//*,,g;s, $(srcdir)//*, ,g' | sed 's,\.,\\\\.,g'`; \ $(MKDEP) $< | sed "$$re" > $@-tmp @if test -n "$o"; then \ sed 's/\.o:/$$o:/' $@-tmp > $@; \ -- 2.43.5