GNU make manual 翻译( 九十五)

简介:

继续翻译

 

复制代码
4.5.5 Directory Search and Implicit Rules
-----------------------------------------

The search through the directories specified in `VPATH' or with `vpath' also happens during consideration of implicit rules (*note Using Implicit Rules: Implicit Rules.).

   For example, when a file `foo.o' has no explicit rule, `make' considers implicit rules, such as the built-in rule to compile `foo.c' if that file exists.  If such a file is lacking in the current directory, the appropriate directories are searched for it.  If `foo.c' exists (or is mentioned in the makefile) in any of the directories, the implicit rule for C compilation is applied.

   The recipes of implicit rules normally use automatic variables as a matter of necessity; consequently they will use the file names found by directory search with no extra effort.
复制代码

 

4.5.5 目录搜索与隐式规则
-----------------------------------------

对 VPATH 或者 vpath 中所指定的目录,隐式规则运行时也会发生(*note Using Implicit Rules: Implicit Rules.)

例如,当一个 foo.o 文件没有显式规则,make 就考虑隐式规则,就好像是编译 foo.c 文件的内建规则。

如果一个文件不在当前目录,将会寻找其他目录,如果此foo.c 文件存在(或者被 makefile提及),C 编译的隐式规则将被应用。

隐式规则的片段正常使用自动变量作为必须的因素;它们将用目录搜索的文件名而不需要额外的设定。

后文待续


本文转自健哥的数据花园博客园博客,原文链接:http://www.cnblogs.com/gaojian/archive/2012/09/20/2694606.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