您的位置:首页 > 其它

GNU make manual 翻译(二十九)

2012-09-13 17:25 316 查看
继续翻译

In practice, we might want to write the rule in a somewhat more
complicated manner to handle unanticipated situations.  We would do
this:

.PHONY : clean
clean :
-rm edit $(objects)

This prevents `make' from getting confused by an actual file called
`clean' and causes it to continue in spite of errors from `rm'.  (See
*note Phony Targets::, and *note Errors in Recipes: Errors.)


在实践中,我们也许想要写一个有点复杂的规则去处理未预料的各种情况。我们应当这样作:

.PHONY : clean

clean :

-rm edit $(objects)

这可以防止 make 发现一个名字为clean 的文件的时候产生歧义。可以让它不至于产生错误而可以继续运行。 (*note Phony Targets::, *note Errors in Recipes: Errors.)

后文待续
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: