此文版权属于作者所有,任何人、媒体或者网站转载、借用都必须征得作者本人同意!

参考:What is the colon equals sign ( := ) in makefiles?

Makefile 文件里面

:=,表示变量赋值的时候立刻展开

=,表示变量被用的时候才展开

下面是例子:

animal=frog
var="$(animal) dog cat"
animal=hello
test:
        @echo $(var)

#输出结果是:
#hello dog cat

animal=frog
var:="$(animal) dog cat"
animal=hello
test:
        @echo $(var)

#输出结果是:
#frog dog cat

makefile 里面 := 和 = 的区别的更多相关文章

  1. [zz] makefile中=和:=的区别

    转载自:http://www.cnblogs.com/wanqieddy/archive/2011/09/21/2184257.html 在Makefile中我们经常看到 = := ?= +=这几个赋 ...

  2. Makefile与shell脚本区别

    http://blog.chinaunix.net/uid-20672257-id-3345593.html 在Makefile可以调用shell脚本,但是Makefile和shell脚本是不同的.本 ...

  3. makefile中":=","=","?=","+=" 之间的区别

    区别:  := 有关位置的等于,值取决于当时位置的值 = 无关位置的等于,值永远等于最后的值 ?= 是如果没有被赋值过就赋予等号后面的值+= 是添加等号后面的值 '=':无关位置的等于 比如: x = ...

  4. makefile中":="和“=”的区别

    在makefile中,经常能看到这种赋值方式: MyNumber := 这种方式洋名叫做expansion assignment, 翻译过来叫扩展赋值, 我一般就叫冒号等号.这位同学就问了,那么它和普 ...

  5. Makefile 中:= ?= += =的区别

    在Makefile中我们经常看到 = := ?= +=这几个赋值运算符,那么他们有什么区别呢?我们来做个简单的实验 新建一个Makefile,内容为:ifdef DEFINE_VRE    VRE = ...

  6. Makefile与shell脚本的区别

    引用博客:Makefile与shell脚本区别 在Makefile可以调用shell脚本,但是Makefile和shell脚本是不同的.本文试着归纳一下Makefile和shell脚本的不同. 1.s ...

  7. 【转】Makefile 中:= ?= += =的区别

    最近接触使用C++项目,需要使用Makefile,因此需要好好学习下. [转自]:http://www.cnblogs.com/wanqieddy/archive/2011/09/21/2184257 ...

  8. Makefile 中:= ?= += =的区别【转】

    转自:http://www.cnblogs.com/wanqieddy/archive/2011/09/21/2184257.html 在Makefile中我们经常看到 = := ?= +=这几个赋值 ...

  9. makefile编写---:= ?= += =的区别

    在Makefile中我们经常看到 = := ?= +=这几个赋值运算符,那么他们有什么区别呢?我们来做个简单的实验 新建一个Makefile,内容为:ifdef DEFINE_VRE    VRE = ...

随机推荐

  1. BZOJ 1812: [Ioi2005]riv( 树形dp )

    树背包, 左儿子右兄弟来表示树, dp(x, y, z)表示结点x, x的子树及x的部分兄弟共建y个伐木场, 离x最近的伐木场是z时的最小代价. 时间复杂度O(N^2*K^2) ----------- ...

  2. Main方法中传入参数

    ↓ 这个时候会报错: Instantiate the class:DonutShop java.lang.ClassNotFoundException: DonutShop    at java.ne ...

  3. PhpStorm 10.0 激活方式

    随着 JetBrains 新版本的发布,注册机已然不行了.然而,道高一尺,魔高一丈.IntelliJ IDEA开源社区 提供了如下通用激活方法:注册时选择License server填写http:// ...

  4. Python中的isinstance函数

    isinstance是Python中的一个内建函数 语法: isinstance(object, classinfo)   如果参数object是classinfo的实例,或者object是class ...

  5. [C++]Store Credit——Google Code Jam Qualification Round Africa 2010

    Google Code Jam Qualification Round Africa 2010 的第一题,很简单. Problem You receive a credit C at a local ...

  6. SQL Server 多表删除

    第一步: 建表 create table t1(x int, y int); create table t2(x int, y int); go insert into t1(x,y) values( ...

  7. Linux 硬盘、网卡

    根据硬盘接口的不同,在Liunx中会有不同的命名 IDE 接口的硬盘会被叫成: hda,hdb,hdc (hd -- hard disk) hda 表示第一块硬盘,hdb表示第二块硬盘! 一般来说我们 ...

  8. mock.js 使用教程

    mock.js 数据模板 #查看模板生成的数据 var data = Mock.mock({ //list|1-10 数组元素个数随机范围, id|+2 属性值递增, age|20-30数值随机范围 ...

  9. java 如何得到ISO 8601 时间格式

    http://blog.csdn.net/brightleo/article/details/7457004 public class DateUtil { public static String  ...

  10. 当cpu飙升时,找出php中可能有问题的代码行

    参考大牛: http://www.searchtb.com/2014/04/%E5%BD%93cpu%E9%A3%99%E5%8D%87%E6%97%B6%EF%BC%8C%E6%89%BE%E5%8 ...