GNU make manual 翻译(十九)

简介:
继续翻译

复制代码
   After recompiling whichever object files need it, `make' decides  
whether to relink `edit'.  This must be done if the file `edit' does
not exist, or if any of the object files are newer than it.  If an 
object file was just recompiled, it is now newer than `edit', so `edit' 
is relinked.                          
                        
   Thus, if we change the file `insert.c' and run `make', `make' will 
compile that file to update `insert.o', and then link `edit'.  If we 
change the file `command.h' and run `make', `make' will recompile the 
object files `kbd.o', `command.o' and `files.o' and then link the file 
`edit'.                        
复制代码
当重新编译了目标文件,make 会判断是否需要重新链接 edit.

如果 edit 尚不存在,则必须链接,或者某个新得到的 目标文件比 edit 心,也需要链接。

如果某目标文件刚被重新变异,它会比edit 新,所以 edit 会被重新链接。

 

因此,如果我们改变了 insert.c 然后运行 make, make 会编译此文件以更新 insert.o,

然后链接 edit。

如果我们改变了 command.h 然后运行 make , make 会 重新编译 kdo.o,command.o 和 files.o,然后链接文件 edit。

后文待续


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