继续翻译

4 Writing Rules
***************                        A "rule" appears in the makefile and says when and how to remake certain files, called the rule's "targets" (most often only one per rule).  It lists the other files that are the "prerequisites" of the target, and the "recipe" to use to create or update the target.                        The order of rules is not significant, except for determining the default goal: the target for `make' to consider, if you do not otherwise specify one.  The default goal is the target of the first rule in the first makefile.  If the first rule has multiple targets, only the first target is taken as the default.  There are two exceptions: a target starting with a period is not a default unless it contains one or more slashes, `/', as well; and, a target that defines a pattern rule has no effect on the default goal.  (*Note Defining and Redefining Pattern Rules: Pattern Rules.)                        Therefore, we usually write the makefile so that the first rule is the one for compiling the entire program or all the programs described by the makefile (often with a target called `all').  *Note Arguments to Specify the Goals: Goals. 

一个规则出现在makefile中,表明何时以及如何重新建立特定的文件--此规则的目的(大多数情况下,每个规则一个文件)。它也列出作为此目的的前提条件的文件列表,还有用来创建和更改目的的片段。

规则的顺序并不重要,除了决定缺省的终点: make 所考虑的目的。如果你不指定一个,那么make就会使用缺省的终点。

缺省的终点就是第一个makefile中的第一个规则的目的。

如果第一个规则有多个目的,那么只有第一个目的被认为是缺省的。

但是有两个例外:以句号开始的目的不是缺省的,除非它还包含一个或多个 /。

在缺省终点,定义模式规则的目的是无效的。(*Note Defining and Redefining Pattern Rules:Pattern Rules)

因此,我们通常写makefile的时候,第一个规则是一个编译整个程序或者所有程序的。

(此目的经常命名为 all)。*Note Arguments to Specify the Goals: Goals

后文待续

GNU make manual 翻译(七十三)相关推荐

  1. GNU make manual 翻译(四十三)

    继续翻译 Another such occasion is when you want to generate prerequisites from source files automaticall ...

  2. GNU make manual 翻译(六十三)

    继续翻译 After the first expansion phase the prerequisites list of the 'myfile' target will be `onefile' ...

  3. GNU make manual 翻译( 一百一十三)

    继续翻译 `.ONESHELL' If `.ONESHELL' is mentioned as a target, then when a target is built all lines of t ...

  4. GNU make manual 翻译( 一百八十三)

    继续翻译 `ifndef VARIABLE-NAME' If the variable VARIABLE-NAME has an empty value, the TEXT-IF-TRUEis eff ...

  5. GNU make manual 翻译( 一百七十五)

    继续翻译 `.DEFAULT_GOAL' Sets the default goal to be used if no targets were specified onthe command lin ...

  6. GNU make manual 翻译( 一百六十三)

    继续翻译 6.6 Appending More Text to Variables ====================================Often it is useful to ...

  7. GNU make manual 翻译(一)

    当分析PostgreSQL 的源代码的时候,经常遇到 Makefile, 读不懂其中的语句,很是令人烦恼.最近准备静下心来,好好地阅读. 为了达到这一目的,进行一次翻译. 复制代码 1 Overvie ...

  8. GNU make manual 翻译( 一百四十九)

    继续翻译 5.7.4 The `--print-directory' Option ------------------------------------If you use several lev ...

  9. GNU make manual 翻译(六十一)

    继续翻译 3.8 Secondary Expansion ======================= In the previous section we learned that GNU `ma ...

最新文章

  1. linux中的apachectl是什么命令
  2. 通过Scroller.js制作上拉加载和下拉刷新
  3. python whl是什么文件
  4. linux基础-延时命令:sleep
  5. 计算机网络-子网划分举例
  6. Spark 配置Kryo序列化机制注意细节
  7. magento去除子分类的url地址中带有父分类的url key
  8. mysql时间聚合_11.MySQL数值、日期和时间、信息、聚合函数
  9. poj Going from u to v or from v to u? 强联通缩点+拓扑排序(或搜索)
  10. 【安全】基于角色的访问控制
  11. 约瑟夫环问题(链表 + 公式)
  12. leetcode955. Delete Columns to Make Sorted II
  13. 2021年中国专业话筒市场趋势报告、技术动态创新及2027年市场预测
  14. linux 永久添加路由表,Linux 添加永久静态路由的方法
  15. 【Animations】使用弹簧物理学动画运动(8)
  16. mysql 数据库授权
  17. JVM -运行时数据区 - 堆空间
  18. php 微信发红包 证书错误,微信支付,使用证书时出现58错误 - 微信公众平台
  19. 《果壳中的C# C# 5.0 权威指南》 (09-26章) - 学习笔记
  20. java excel 模板 替换_java替换Excel字符

热门文章

  1. 微信小程序php get_php处理微信小程序request请求
  2. homepage php,HomePage.php
  3. c++ python opencv_ubuntu下C++与Python混编,opencv中mat类转换
  4. php 清除缓存的操作,注意 Laravel 清除缓存 PHP artisan cache:clear 的使用
  5. golang mac 环境变量_macOS 配置 golang 运行环境
  6. java中 d_Java 中的 syncronized 你真的用对了吗
  7. python中字符串文件如何打开_python-字符串·文件·集合操作
  8. linux识别新加存储盘,Linux下新加磁盘
  9. javascript错误处理与调试
  10. 瑞数(裁判文书)js的加密分析