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)
上一篇 2022年3月12日 下午5:00
下一篇 2022年3月12日 下午5:35


相关推荐

  • Coze(扣子)工作流基础核心课

    Coze(扣子)工作流基础核心课

    2026年3月16日
    3
  • Threading(in thread main)

    PainlessThreadingThisarticlediscussesthethreadingmodelusedbyAndroidapplicationsandhowapplicationscanensurebestUIperformancebyspawningworkerthreadstohandlelong-runningoperat

    2022年4月15日
    27
  • Excel中的VBA编程「建议收藏」

    Excel中的VBA编程「建议收藏」目的:有时我们需要对Excel文件中大量的数据进行整理,此时如果使用手动整理会非常繁琐而且容易出错。而如果采用VBA语言,在Excel中根据需求编写一段简单的代码就能自动完成大量数据的整理工作。以Excel2007为例,如果要进行VBA编程,需要启用“开发工具”选项。在Excel选项对话框中勾选【在功能区显示“开发工具“选项卡】复选框。基本语法:1、给当前工作表的

    2022年5月7日
    52
  • 免688申请苹果开发者证书,开发自己得苹果应用

    免688申请苹果开发者证书,开发自己得苹果应用我们都知道 在开发苹果应用时需要使用签名 证书 才能进行安装苹果 IPA 但是官方给的步骤过于麻烦 本次教程围绕一款名为 APPUploader 的平台进行简单几步操作开发自己的苹果应用 首先在苹果官网申请账号 https appleid apple com account 填写完相关信息后 我们进入 APPUploader 下载软件进行使用软件包含多个系统版本 windows MAC Linux 各位可以根据自己的操作系统进行下载下载完成后 解压至桌面会得到一下文件 首先我们打开 readm

    2026年3月16日
    2
  • java在线编辑_十大在线编译器(IDE),干货收藏!

    java在线编辑_十大在线编译器(IDE),干货收藏!文章来源:网络整理:薛定谔的coding猫1.CodeSandbox(基于React的在线代码沙盒平台)①主流的脚手架都支持,比如在线create-react-app,vue-cli等(在线fork修改),支持github登录(项目导入),也支持cli上传例子,例子可以在线访问和下载,当然也支持内嵌到其他博客等网页中。②地址:https://codesandbox.i…

    2022年7月8日
    152
  • eclipse安装lombok插件 出现打不开(lombok插件怎么读)

    1、下载lombok.jar,lombok.jar官方下载地址:https://projectlombok.org/download如果下载不了的话,下面是我个人的百度云资源:链接:https://pan.baidu.com/s/1Eiwy0Kb6OxCDuZw0O268kg提取码:ds772、双击下载好的lombak.jar,安装步骤如下:2-1…

    2022年4月17日
    176

发表回复

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

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