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。

后文待续

posted @ 2012-09-13 15:03  健哥的数据花园  阅读(262)  评论(0编辑  收藏  举报