zoukankan      html  css  js  c++  java
  • GNU make manual 翻译(二十三)

    继续翻译

    2.5 Letting `make' Deduce the Recipes                        
    =====================================                        
                            
    It is not necessary to spell out the recipes for compiling the 
    individual C source files, because `make' can figure them out: it has an 
    implicit rule for updating a `.o' file from a correspondingly named
    `.c' file using a `cc -c' command.  For example, it will use the recipe 
    `cc -c main.c -o main.o' to compile `main.c' into `main.o'.  We can 
    therefore omit the recipes from the rules for the object files.  *Note 
    Using Implicit Rules: Implicit Rules.                        
                            
       When a `.c' file is used automatically in this way, it is also 
    automatically added to the list of prerequisites.  We can therefore omit 
    the `.c' files from the prerequisites, provided we omit the recipe. 

     让 make 减少 片段数量

    为了编译单独的 C 源文件,没有必要写出单独的片段。

    因为 make 可以把他们识别出来:

    这里有一个隐含的规则:需要改变一个.o文件的时候,要用 cc -c 命令来处理 .c 文件。

    例如,make 将用 cc -c main.c -o main.o 来编译 main.c 为 main.o。

    我们因此可以省略 这些为 目标文件而定的片段。

    *Note Using Implicit Rules: Implicit Rules 

    后文待续

  • 相关阅读:
    DOM 与BOM
    尝试json文件导入数据
    js事件监听简介
    js事件简介
    js中的for语句简介
    作业练习正则表达式
    简单总结-BOM
    web前端第三次作业em,fr,rem,px简单解释及颜色表
    web第二次作业练习grid
    web前端课程第一次作业----注册页面代码(2018-9-14)
  • 原文地址:https://www.cnblogs.com/gaojian/p/2683516.html
Copyright © 2011-2022 走看看