On Mon, Jan 31, 2011 at 10:45:34PM +0000, David Holland wrote: >> However, as I recall it ought to work ok to do >> >> Var_Set(".PARSEDIR", "$(.CURDIR)", VAR_GLOBAL, 0); >> >> instead. >> >> However, this still isn't a correct fix as it doesn't take care of the >> case when e.g. including ../Makefile.inc. > > Furthermore, before going around hacking make, please come up with an > isolated test case where make does the wrong thing. So far I can't > find one.
So for the record the problem is caused when (1) neither MAKEOBJDIR nor MAKEOBJDIRPREFIX is set; (2) no matching objdir exists at make startup; (3) after that point OBJDIR is explicitly assigned to something that *does* exist; (4) at that time make chdirs but does not update .PARSEDIR. Making .PARSEDIR always absolute should fix this problem, but in the general case requires realpath(). However, I'm guessing that .PARSEDIR may not be the only path variable affected -- ISTM that the right thing to do is to track down why assigning OBJDIR after startup does not update all the same things that assigning it during startup does, and fix that. (And, preferably, fix it so the code is shared and it won't break again.) -- David A. Holland dholl...@netbsd.org