GNU make manual 翻译(二)

继续翻译

Preparing and Running Make    
==========================    
    
   To prepare to use `make', you must write a file called the    
makefile that describes the relationships among files in your program    
and provides commands for updating each file.  In a program, typically,    
the executable file is updated from object files, which are in turn    
made by compiling source files.    
    
   Once a suitable makefile exists, each time you change some source    
files, this simple shell command:    
    
     make    
    
suffices to perform all necessary recompilations.  The `make' program    
uses the makefile data base and the last-modification times of the    
files to decide which of the files need to be updated.  For each of    
those files, it issues the recipes recorded in the data base.    
    
   You can provide command line arguments to `make' to control which    
files should be recompiled, or how.  *Note How to Run `make': Running.    

准备和运行 make

为了准备运行 make, 你必须写一个名为 "makefile" 的文件。该文件描述你的程序项目中的文件之间关系,

也提供改变各个文件的指令。

在一个典型的程序项目中,可执行文件由 目标文件而来,而目标文件又是由对源文件的编译而来。

一旦做好了一个适当的 makefile, 每次你修改一些源文件的时候,下面的简单的shell 命令:

  make

就会担当起所有重新编译的任务。这个 make 程序使用  makefile中的数据信息 和 各文件的被修改时间,

来决定那些文件需要被改变。对每一个需要被改变的文件,它都会根据 makefile的数据信息来执行相应的指令片段。

你可以向make 提供 命令行参数, 来控制那些文件需要被重新编译和如何被重新编译。

后文待续

转载于:https://www.cnblogs.com/gaojian/archive/2012/09/12/2681618.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值