MS nmake 相当于 $(MAKECMDGOALS)

发布于 2024-07-19 04:20:28 字数 337 浏览 8 评论 0原文

我使用的是(有些过时的)Microsoft 版本的 nmake,它通常与 Visual Studio 6.0 一起打包。 (如果有更新的 nmake 的相关答案 - 请告诉我,我可能会考虑升级)。

我希望更改现有的 makefile,这样如果它与 nmake dpndfull 目标一起运行,它就不会包含依赖项列表,该目标应该构建依赖项列表。

使用 GNU make,我将测试 dpndfull 是否在 MAKECMDGOALS 中,如果是,我不会包含(可能不存在的)依赖项列表。

有什么想法如何使用 nmake 找到当前的 make 目标吗?

I'm using a (somewhat outdated) Microsoft version of nmake, which is usually packaged with visual studio 6.0. (If there's a relevant answer for newer nmake - do let me know, I might consider upgrading).

I wish to alter existing makefile, so that it would not include the dependency list if it is ran with the nmake dpndfull goal, which should build the dependency list.

With GNU make I would test if dpndfull is in MAKECMDGOALS, and if it does I wouldn't include the (maybe nonexisting) dependency list.

Any ideas how to find current make goal with nmake?

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

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

发布评论

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

评论(1

追我者格杀勿论 2024-07-26 04:20:28

这个问题已经存在五年了,却无人触及。 因此它认为答案是适当的。

答案很简单。 。 Microsoft NMAKE 中没有明显的与 MAKECMDGOALS 等效的内容。 在执行 makefile 期间,无法发现调用它的命令行上提供的内容。 有宏 $(MAKEFLAGS) 但它只显示标志而不显示目标。

实现所要求的唯一方法是为 dpndfull 制定目标规则,然后在该位置使用构建依赖项的方法。 关于如何为 NMAKE 构建这些的讨论可以在问题 makedepend equal to use with nmake?

This question has lay around for five years now and no one has touched it. So it thought an answer would be appropriate.

The answer is simple. No. There is no obvious equivalent of MAKECMDGOALS in Microsoft NMAKE. There is no way, during the execution of the makefile to discover what was supplied on the command line invoking it. There is the macro $(MAKEFLAGS) but that only shows flags and not the targets.

The only method to achieve what is asked is to make a target rule for dpndfull and then at that place use the methods for constructing dependencies. A discussion of how to build these for NMAKE can be found in the question makedepend equivalent for use with nmake?.

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