GNU make manual 翻译(五十七)

简介:
继续翻译

复制代码
   It's important to understand this two-phase approach because it has a direct impact on how variable and function expansion happens; this is often a source of some confusion when writing makefiles.  Here we will present a summary of the phases in which expansion happens for different  constructs within the makefile.  We say that expansion is "immediate"if it happens during the first phase: in this case `make' will expand any variables or functions in that section of a construct as the
makefile is parsed.  We say that expansion is "deferred" if expansion is not performed immediately.  Expansion of a deferred construct is not performed until either the construct appears later in an immediate context, or until the second phase.
                        
   You may not be familiar with some of these constructs yet.  You can reference this section as you become familiar with them, in later                        
chapters.                        
复制代码
理解这两个阶段,是十分重要的,因为它对变量和函数如何展开有直接的影响。这常常是写makefile时造成困扰的源头。这里我们将要对这两个阶段给出一个关于扩展(变量和函数)的总结。

我们说,在第一阶段,扩展是立即发生的:在这种情形下,make分析makefile时,在构建的时候, 要展开所有变量和函数。我们说如果扩展不是立即执行,那么这种扩展将被推迟。

对一个推迟性的构造,扩展不会发生,直到此构造出现在一个立即性的上下文中的时候,或者直到第二个阶段。

 

也许你还太熟悉某些构造。你可以在后面的章节中,后来参照此节。

后文待续


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