Subject: 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 16:10:42
With the following makefile:
.SUFFIXES:
.SUFFIXES: .a .b
all: .PHONY x.b
.a.b:
echo $<
x.b: dir/x.a
make tries to generate x.b using the commands from the .a.b suffix rule,
but using the source file dir/x.a, rather that the source
file implied by the suffix rule.
I'm not sure this is (ever) desirable.
Note that it requies the filename to match - so it will only ever
build x.a, never y.a using the commands from the suffix rule.
It causes particular problems when the 'x.b: dir/x.a' line comes
from the .depend file which also contains '.OPTIONAL: dir/x.a' and
the source files have all been moved to a different directory.
Does anyone think this is a desirable feature?
If I fix it, is anything else likely to break?
David
--
David Laight: david@l8s.co.uk