且构网

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

GNU make manual 翻译(十六)

更新时间:2022-09-21 09:14:49

继续翻译

复制代码
2.3 How `make' Processes a Makefile    
===================================    
    
By default, `make' starts with the first target (not targets whose    
names start with `.').  This is called the "default goal".  ("Goals"    
are the targets that `make' strives ultimately to update.    You can    
override this behavior using the command line (*note Arguments to    
Specify the Goals: Goals.) or with the `.DEFAULT_GOAL' special variable    
(*note Other Special Variables: Special Variables.).      
    
   In the simple example of the previous section, the default goal is to    
update the executable program `edit'; therefore, we put that rule first.  
复制代码
make 如何处理一个 Makefile

缺省情况下,make 启动时执行第一个目的。这被称为缺省终点。

(终点(goal) 就是 make 努力要最终达成的改变。)

你可以通过使用命令行来改变这种行为(*note Arguments to Specify the Goals: Goals.)

或者 用 .DEFAULT_GOAL 特殊变量(*note Other Special Variables: Special Variables.)

在前面的 简单的例子章节中,缺省的终点是 改变 可执行程序 edit。 因此我们把这个规则放在最前面。

后文待续


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