GNU make manual 翻译( 一百一十八)

GNU make manual 翻译( 一百一十八)

大家好,又见面了,我是全栈君。

继续翻译

复制代码
   `%' characters in pattern rules can be quoted with preceding
backslashes (`\').  Backslashes that would otherwise quote `%'
characters can be quoted with more backslashes.  Backslashes that quote
`%' characters or other backslashes are removed from the pattern before
it is compared to file names or has a stem substituted into it.
Backslashes that are not in danger of quoting `%' characters go
unmolested.  For example, the pattern `the\%weird\\%pattern\\' has
`the%weird\' preceding the operative `%' character, and `pattern\\'
following it.  The final two backslashes are left alone because they
cannot affect any `%' character.

   Here is an example, which compiles each of `foo.o' and `bar.o' from
the corresponding `.c' file:

     objects = foo.o bar.o

     all: $(objects)

     $(objects): %.o: %.c
             $(CC) -c $(CFLAGS) $< -o $@

Here `$<' is the automatic variable that holds the name of the
prerequisite and `$@' is the automatic variable that holds the name of
the target; see *note Automatic Variables::.
复制代码

在模式规则中的%符号可以通过反斜线被引用。反斜线也可以通过反斜线被引用。在开始比较文件名或者由一个枝干用于替换前,引用%符号的反斜线或者引用反斜线的反斜线会被模式移出。和引用 % 符号无关的反斜线被忽略。例如,模式 ‘the\%weird\\%pattern\\’ 在 操作性的%符号前有一个前置的 ‘the%weird\’, 后面有一个 ‘pattern\\’, 最后的两个反斜线就留在那里,因为它们对 %符号没有影响。 

Here is an example, which compiles each of `foo.o’ and `bar.o’ from
the corresponding `.c’ file:

这里有一个例子,从相应的.c 文件中,编译每一个 foo.o 和 bar.o 文件。

objects = foo.o bar.o

all: $(objects)

$(objects): %.o: %.c
$(CC) -c $(CFLAGS) $< -o $@

这里,$< 是自动变量,其保存着前提条件的名字,$@是自动变量,其保留着目的的名字。

参见 *note Automatic Variables::

后文待续

本文转自健哥的数据花园博客园博客,原文链接:http://www.cnblogs.com/gaojian/archive/2012/09/26/2703353.html,如需转载请自行联系原作者

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/107815.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • 【教程】Spring+Mybatis环境配置多数据源

    一、简要概述在做项目的时候遇到需要从两个数据源获取数据,项目使用的Spring + Mybatis环境,看到网上有一些关于多数据源的配置,自己也整理学习一下,然后自动切换实现从不同的数据源获取数据功能。二、代码详解2.1 DataSourceConstants 数据源常量类/** * 数据源名称常量类 * 对应 application.xml 中 bean multipleDataSo…

    2022年2月27日
    29
  • idea在线激活码(注册激活)「建议收藏」

    (idea在线激活码)JetBrains旗下有多款编译器工具(如:IntelliJ、WebStorm、PyCharm等)在各编程领域几乎都占据了垄断地位。建立在开源IntelliJ平台之上,过去15年以来,JetBrains一直在不断发展和完善这个平台。这个平台可以针对您的开发工作流进行微调并且能够提供…

    2022年3月26日
    424
  • 【数据结构与算法】深入浅出递归和迭代的通用转换思想[通俗易懂]

    【数据结构与算法】深入浅出递归和迭代的通用转换思想[通俗易懂]递归和递归的深入浅出一般来说,能用迭代的地方就不要用递归!理论上讲,所有的递归和迭代之间都能相互转换!(一)何为迭代?首先我们来看下面这段简单的代码:intsum(intn){intsum=0;for(inti=1;i<=n;i++)sum+=n;//求解1~n的和returnsum;}从上述例子中,从1一直加到n,每一次的和都

    2022年6月5日
    34
  • NOIP普及组套题_noip2019普及组试题

    NOIP普及组套题_noip2019普及组试题题目链接题目描述给定一个整数,请将该数各个位上数字反转得到一个新数。新数也应满足整数的常见形式,即除非给定的原数为零,否则反转后得到的新数的最高位数字不应为零(参见样例2)。输入格式一个整数N输出格式一个整数,表示反转后的新数。输入输出样例输入#1123输出#1321输入#2-380输出#2-83代码://P1307数字反转#include<iostream>#include<cstring>usingnamespacestd;

    2022年9月24日
    0
  • 完美解决安装MySQL Install/Remove of the Service Denied!错误解决办法

    完美解决安装MySQL Install/Remove of the Service Denied!错误解决办法

    2021年10月2日
    213
  • HandlerSocket_handler的使用

    HandlerSocket_handler的使用HandlerSocket的原理http://www.mysqlops.com/2011/10/19/handlersocket-principle.htmlHandlerSocket的性能测试http://www.mysqlops.com/2011/10/20/handlersocket-perf.htmlHandlerSock

    2022年8月24日
    3

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号