Makefile语法 [英] Makefile Grammar

查看:90
本文介绍了Makefile语法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

精确的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 ...

为make编写语法会很棘手,因为语法是 高度依赖上下文.

It would be tricky to write a grammar for make, since the grammar is extremely context-dependent.

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语法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆