且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

GNU make manual 翻译(七十八)

更新时间:2022-08-19 14:28:36

继续翻译

复制代码
4.3 Types of Prerequisites                        
==========================                        
                        
There are actually two different types of prerequisites understood by GNU `make': normal prerequisites such as described in the previous section, and "order-only" prerequisites.  A normal prerequisite makes two statements: first, it imposes an order in which recipes will be invoked: the recipes for all prerequisites of a target will be completed before the recipe for the target is run.  Second, it imposes a dependency relationship: if any prerequisite is newer than the target, then the target is considered out-of-date and must be rebuilt. 
                        
   Normally, this is exactly what you want: if a target's prerequisite 
is updated, then the target should also be updated.                        
复制代码
4.3 前提条件的类型
==========================
GNU make 可以理解两种不同类型的前提条件:

前面章节中描述的普通的前提条件,以及 仅排序 前提条件。

一个普通的前提条件完成两件事:首先,它确立了一个顺序,片段被激活的时候要运用此顺序:

一个目的的所有前提条件都将被完成后,此目的的片段才会执行。

第二,它确立了一个依赖关系: 如果任何前提条件比目的新,则目的被认为已经过期,需要重新构建。

通常,这正是你所想要的:如果一个前提条件被修改了,那么目的也需要被修改。

 

后文待续


本文转自健哥的数据花园博客园博客,原文链接:http://www.cnblogs.com/gaojian/archive/2012/09/18/2690756.html,如需转载请自行联系原作者