GNU make manual 翻译(十五)

简介:
继续翻译

复制代码
   The target `clean' is not a file, but merely the name of an action.    
Since you normally do not want to carry out the actions in this rule,    
`clean' is not a prerequisite of any other rule.  Consequently, `make'    
never does anything with it unless you tell it specifically.  Note that    
this rule not only is not a prerequisite, it also does not have any    
prerequisites, so the only purpose of the rule is to run the specified    
recipe.  Targets that do not refer to files but are just actions are    
called "phony targets".  *Note Phony Targets::, for information about    
this kind of target.  *Note Errors in Recipes: Errors, to see how to    
cause `make' to ignore errors from `rm' or any other command.      
复制代码
 目的 clean 不是一个文件,是一个动作的名称。

 由于通常你不会想要执行此规则中的动作,clean 不是任何其他 rule 的 前提条条件。

除非你只告诉它要这么做,make 绝不会执行 clean 的。

注意这个规则(的目的)不但不是任何其他规则的前提条件,它自身也没有任何前提条件。

所以,各个规则的唯一作用就是要运行特定的片段。

与文件无关只是执行动作的 目的,被称为伪目的(phony targets)。

可以参考 (*Note Phony Targets) 进行相应的了解。

可以参考 (*Note Errors in Recipes:Errors),了解如何使得 make 忽略错误(如执行rm导致)。

后文待续


本文转自健哥的数据花园博客园博客,原文链接:http://www.cnblogs.com/gaojian/archive/2012/09/12/2681993.html,如需转载请自行联系原作者
目录
相关文章
|
Linux C语言
make: gcc:命令未找到
make: gcc:命令未找到
make: gcc:命令未找到
|
C语言 C++ Perl
如何处理错误消息Please install the gcc make perl packages
如何处理错误消息Please install the gcc make perl packages
142 0