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)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • 日记本[通俗易懂]

    日记本[通俗易懂]1、懒人版安装教程:http://zengwu3915.blog.163.com/blog/static/278348972013448020461/

    2022年5月13日
    52
  • SchedulerFactoryBean[通俗易懂]

    SchedulerFactoryBean[通俗易懂]&lt;?xmlversion="1.0"encoding="UTF-8"?&gt;&lt;beans&gt;&lt;beanid="scheduler"class="org.springframework.scheduling.quartz.SchedulerFactoryBean"lazy-init="false"&gt;&lt;prope

    2022年5月10日
    48
  • 移动端app开发,框架的选择。

    移动端app开发,框架的选择。从事java开发快三年了,最近公司因项目要求需要做一款app,个人对这方面兴趣比较大,于是网上收集资料,框架的选择,技术的论证,到今天项目需求的各个功能都做出了相应的demo同时也打好了框架,接下来就是完成细节的部分了。接下来自己会在github更新自己相应的demo,最后也将会更新整个项目,写博客的目的就是希望自己养成做笔记的习惯,同时鞭策自己不断的学习新的知识。框架的选择,因为一直在关注前端方

    2022年6月29日
    32
  • python encode和decode函数说明_python中文处理之encode/decode函数「建议收藏」

    python encode和decode函数说明_python中文处理之encode/decode函数「建议收藏」python中文处理相信迷惑过不少同学。下面说说python2/3的encode和decode函数。python2中,使用decode()和encode()来进行解码和编码,以unicode类型作为中间类型。即decode  encodestr———>unicode———>str示例(注意encode和decode的编码必须保持一致)…

    2022年9月25日
    4
  • java四舍五入函数的用法

    java四舍五入函数的用法java中使用内置函数实现四舍五入,java中四舍五入函数讲解…

    2022年5月21日
    51
  • linux 防火墙开放端口_防火墙放行端口

    linux 防火墙开放端口_防火墙放行端口Linux防火墙常用操作及端口开放1.查看防火墙状态firewall-cmd–state2.开启防火墙systemctlstartfirewalld.service3.开启指定端口firewall-cmd–zone=public–add-port=3306/tcp–permanentfirewall-cmd–zone=public–add-port=6379/tcp–permanent显示success表示成功–zone=public表示作用域为公共的

    2025年12月4日
    2

发表回复

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

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