问题描述
精确的makefile语法定义在任何地方吗?或者至少是一些常见的子集,因为我猜有一些味道.这样的语法可用于编写解析器.
Is there anywhere a precise makefile grammar definition? Or at least some common subset since I guess that there are some flavors. Such a grammar that could be used for writing a parser.
GNU Make手册似乎不那么精确.基于该文档为makefile编写解析器将需要一些猜测和反复试验.
GNU Make manual doesn't seem to be that precise. It would require some guessing and trial-and-error to write a parser for makefile based on that document.
我还在ANTLR邮件列表上找到了类似的问题.但是仍然没有答案是哪种建议...
I also found a similar question on ANTLR mail list. But it remained unanswered which kind of suggests the answer...
推荐答案
似乎没有针对gnu make的官方语法,而且...
It seems there is no official grammar for gnu make, and ...
Paul D. Smith在 gnu邮件列表中的消息中说,.保罗·史密斯(Paul D. Smith)是gnu make的官方维护者.
As said by Paul D. Smith in a message in the gnu make mailing list. Paul D. Smith is the official maintainer of gnu make.
这篇关于Makefile语法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!