tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: make: Unclosed variable specification for

On Tue, Jan 06, 2009 at 02:45:12PM +1030, Berndt Josef Wulf wrote:
 > [...] my feeling is that the make parser should cope with this
 > situation such as this, or at least make an effort to return a
 > somewhat more descriptive error message containing information that
 > accurately points to the source of the problem.

In principle, certainly. In practice, it's fairly difficult even if
make weren't a mess inside, because make syntax isn't really
structured enough. And on top of that, make *is* kind of a mess
inside. A lot of the current problems arise because it parses and
re-parses and scans over the same text repeatedly and doesn't always
use quite the same rules each time.

I think make ought to be hacked up so it parses to abstract syntax,
and then does variable expansion/substitution on the abstract syntax
instead of on text; this would fix all these problems consistently and
permanently(*), but it's a massive rework of the internals and thus a
huge job. (If I had an infinite amount of time I'd be quite happy to
do it, but I'm already massively oversubscribed.)

(*) (as well as also allowing caching of preparsed makefile fragments,
optimization passes, and other good stuff...)

David A. Holland

Home | Main Index | Thread Index | Old Index