This is the mail archive of the
cygwin
mailing list for the Cygwin project.
RE: Cygwin make thinks a statement can be neither true nor false....
%% "Dave Korn" <dk@artimi.com> writes:
dk> Hmm. So might there be call for a variant of
dk> --warn-undefined-variables that only warns about those for which
dk> $(origin ..) returns undefined? That way makefiles could supply
dk> empty-but-overrideable definitions of CFLAGS etc, and everyone's
dk> happy... I think?
--warn-undefined-variables already only warns about truly undefined
variables. It won't warn about variables which are defined but empty.
>> As gross as the syntax is, the make parser has to be equally quirky in
>> order to handle it :-/.
dk> Yeh. I wonder if it would be possible to build a proper parser,
dk> using lexx/yacc/bison/whatever. But I guess it would be very hard
dk> to guarantee that it behaved in the same way as the original one
dk> for backward compatibility purposes.
The thing about make grammar is that is not in any way LALR. In fact,
make syntax is really a few completely different "languages" in
different contexts, each with their own unique set of semantic, and even
lexical!, rules.
Writing a parser for it would be interesting, but I suspect it would be
a _LOT_ of work, and would need to use a lot of special features of
whatever LR tool you chose. Something like PCCTS might be better suited :).
--
-------------------------------------------------------------------------------
Paul D. Smith <psmith@gnu.org> Find some GNU make tips at:
http://www.gnu.org http://make.paulandlesley.org
"Please remain calm...I may be mad, but I am a professional." --Mad Scientist
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/