继续翻译

6.6 Appending More Text to Variables
====================================Often it is useful to add more text to the value of a variable already
defined.  You do this with a line containing `+=', like this:
objects += another.oThis takes the value of the variable `objects', and adds the text
`another.o' to it (preceded by a single space).  Thus:
objects = main.o foo.o bar.o utils.oobjects += another.osets `objects' to `main.o foo.o bar.o utils.o another.o'.Using `+=' is similar to:
objects = main.o foo.o bar.o utils.oobjects := $(objects) another.obut differs in ways that become important when you use more complex
values.When the variable in question has not been defined before, `+=' acts
just like normal `=': it defines a recursively-expanded variable.
However, when there _is_ a previous definition, exactly what `+=' does
depends on what flavor of variable you defined originally.  *Note The
Two Flavors of Variables: Flavors, for an explanation of the two
flavors of variables.

6.6 给变量追加更多文本
====================================

给一个已经定义好的变量追加更多的文本经常是很有用的。你可以用一行包含+=的行来做这件事。向这样:

objects += another.o

这将获得变量objects得值,然后把another.o 追加到它后面(前面放一个空格)。因此:

objects = main.o foo.o bar.o utils.o
objects += another.o

设置 `objects' 为 `main.o foo.o bar.o utils.o another.o'。

Using `+=' 等同于:

objects = main.o foo.o bar.o utils.o

objects := $(objects) another.o

但是当你使用更加复杂的值的时候,其差异就变得重要了。

当上述问题中的变量没有被定义的时候,+=就像通常的=: 一样,它定义了一个递归的变量。但是当变量已经有了定义,+=要做的依赖于你事前定义此变量所用的风格。关于变量两种风格,参照 *Note the Tow Flavors of Variables: Flavors

后文待续

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

GNU make manual 翻译( 一百六十三)相关推荐

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

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

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

    继续翻译 The only restriction on this sort of use of nested variable references is that they cannot spec ...

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

    继续翻译 When you add to a variable's value with `+=', `make' acts essentially as if you had included th ...

  4. GNU make manual 翻译( 一百六十二)

    继续翻译 6.5 Setting Variables =====================To set a variable from the makefile, write a line st ...

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

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

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

    继续翻译 6.2 The Two Flavors of Variables ================================There are two ways that a vari ...

  7. GNU make manual 翻译( 一百二十四)

    继续翻译 Note that such a prerequisite constitutes mentioning `main.o' in a makefile, so it can never be ...

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

    继续翻译 6.1 Basics of Variable References =================================To substitute a variable's v ...

  9. GNU make manual 翻译( 一百二十一)

    继续翻译 4.13 Double-Colon Rules =======================Double-colon rules are explicit rules written wi ...

最新文章

  1. 硬件:固态硬盘SSD的基础知识及安装注意事项!
  2. iis发布网站怎么支持.json文件
  3. gitlab与已安装nginx(tengine)冲突解决方案,使用自己安装的nginx(tengine)
  4. Tomcat8中URI不支持{}|等特殊字符解决方案
  5. 显卡a卡和n卡的区别
  6. 时序动作检测《BMN: Boundary-Matching Network for Temporal Action Proposal Generation》
  7. 十七、DPM模型参数设置详解
  8. 该网页无法正常运作xxxx将您重定向的次数过多
  9. sim7600ce使用MQTT协议总结
  10. vue/cli 和 vue 版本对应及安装
  11. 室内陈设设计有必要吗,室内陈设设计要注意什么
  12. C++里面头文件和源文件都要怎么编写以及运行
  13. mac移动硬盘初始化
  14. 美中嘉和赴港IPO背后:毛利率大幅下滑,杨建宇控股2家公司均亏损
  15. 9月29 Redis配置不当致使root被提权漏洞 | Found a swap file by the name swp
  16. 如何高效自动检测电池产品性能?
  17. 好用的mac软件推荐,看程序员的电脑里都装了什么
  18. Echaer图表 组件传值,页面刷新数据丢失
  19. composer安装阿里大鱼扩展
  20. matlab/simulink 汽车空调机模型

热门文章

  1. 不要忽视Lazada,技术正在成为重构东南亚电商的关键因子
  2. 一张图 综合交通 解决方案_构建区域综合交通枢纽 京津冀将形成“一张图”
  3. 背包算法 java_背包问题算法java实现
  4. Bellhop 从入门到上手
  5. C++Builder文件操作大全
  6. 嵌入式audio基础(一)接口
  7. SAP 跨工厂采购订单交易(两工厂都要看出收入和成本)
  8. ShardingSphere分库分表(SpringBoot+mybatis+mysql)配置
  9. Android利用SurfaceView 实现水印相机,仿钉钉
  10. 计算机设计大赛评分,附表2计算机设计大赛作品要求及评分标准.doc