Subject: Re: make seems to find the wrong source file
To: None <tech-toolchain@netbsd.org>
From: David Laight <david@l8s.co.uk>
List: tech-toolchain
Date: 01/11/2004 18:08:34
> Does anyone think this is a desirable feature?
> If I fix it, is anything else likely to break?
This change stops the problem with .OPTIONAL files.
Index: suff.c
===================================================================
RCS file: /cvsroot/src/usr.bin/make/suff.c,v
retrieving revision 1.43
diff -u -p -r1.43 suff.c
--- suff.c 2004/01/11 17:24:25 1.43
+++ suff.c 2004/01/11 17:28:24
@@ -1425,6 +1425,16 @@ SuffFindCmds(Src *targ, Lst slst)
}
s = (GNode *)Lst_Datum (ln);
+ if (s->type & OP_OPTIONAL) {
+ /*
+ * We haven't looked to see if .OPTIONAL files exist yet, so
+ * don't use one as the implicit source.
+ * Needed for rules from .depend files when the source file
+ * has been moved.
+ */
+ continue;
+ }
+
cp = strrchr (s->name, '/');
if (cp == (char *)NULL) {
cp = s->name;
The entire purpose of SuffFindCmds() seems to be to locate the
wrong .c file :-(
David
--
David Laight: david@l8s.co.uk