“.target-name”会被删除吗? make 文件中的目标总是运行?

发布于 2024-07-13 03:50:57 字数 217 浏览 6 评论 0 原文

我对 make 和 makefile 很陌生,所以如果这是非常基本的,请原谅我。

我正在查看项目中的一些 makefile,我看到了两种类型的目标——不以 . 性格和目标。

据我猜测,“.target-name”目标似乎总是被执行,我的假设是真的吗? 我确实通过谷歌搜索了解了 makefile,但没有找到任何特定于此的内容。

一如既往,感谢您的回答!

I'm new to make and makefiles, so forgive me if this is very basic.

I'm looking through some makefiles in my project and I'm seeing 2 types of targets -- targets that don't begin with a . character and targets that do.

And from what I'm guessing, it seems like the ".target-name" targets are always executed, is my assumption true? I did read about makefiles by Googling but didn't find anything specific to this.

And as always, thanks for the answers!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

好久不见√ 2024-07-20 03:50:57

不。

带有点的目标通常是具有特殊含义的目标(即它们的功能内置于 make 中)。 其中之一是
.PHONY,这是定义始终执行的目标的目标(这意味着其规则中的命令是无条件运行的)。

但还有其他规则,例如默认规则的 .DEFAULT,或中断时不删除隐式构建目标的 .PRECIOUS。

No.

The targets with a dot are normally special meaning targets (i.e. their functioniality is builtin into make). One of them is
.PHONY, this is the one that defines the targets which are always executed (that means, the commands in their rules are run unconditionally).

But there are also others, like .DEFAULT for the default rule, or .PRECIOUS with does not delete implicit built targets when interrupted.

小情绪 2024-07-20 03:50:57

要了解 make,尤其是 gmake,我建议您看一下优秀的书“Managing Projects with GNU Make”(已清理的亚马逊链接)。

HTH。

干杯,

For learning about make, and especially gmake, I'd suggest having a look at the excellent book "Managing Projects with GNU Make" (sanitised Amazon link).

HTH.

cheers,

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文