我有两个目标test
在我的 Makefile 和一个名为的目录中test
在我的项目中。在 GNU Make 中我可以像这样声明它是假的:
.PHONY: all compile test clean docs static
在 NMake 中可以做同样的事情吗?根据http://www.bell-labs.com/project/nmake/tutorial/s6.html, 我需要去做
test: .VIRTUAL
但它不起作用:
F:\SomePath>nmake test /f msvc.mk
Microsoft (R) Program Maintenance Utility Version 10.00.30319.01
Copyright (C) Microsoft Corporation. All rights reserved.
NMAKE : fatal error U1073: don't know how to make '.VIRTUAL'
Stop.
对于那些正在寻找解决 nmake 中缺少的 .PHONY 问题的方法的人:
您可以引入一个肯定是伪目标的目标(即选择一个与任何现有文件/目录都不匹配的名称),并使其依赖于您所指的 .PHONY。例如。:
test: .phony
dir /b
.phony:
这是输出:
D:\Temp\nmake-phony>nmake
Microsoft (R) Program Maintenance Utility Version 12.00.21005.1
Copyright (C) Microsoft Corporation. All rights reserved.
dir /b
Makefile
test
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)