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

参考: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. shell中常用的特殊字符

    (1) * 代表0到无穷个任意字符 (2)?代表任意一个字符 (3)代表括号内任意一个字符 (4)[ - ] 代表一个范围中的任意一个字符 如[0-9] 即是代表0-9之间的一个数 (5)[^] 反向 ...

  2. Ubuntu Server修改IP、DNS、hosts

    本文记录下Ubuntu Server 16.04修改IP.DNS.hosts的方法 -------- 1. Ubuntu Server 修改IP sudo vi /etc/network/interf ...

  3. while和for可以相互转换例子

    //while和for循环可以相互转换,以下为简单格式: ;;) A; 等价于 : ) { A; ; } /* Name:while和for可以相互转换例子 Copyright: By.不懂网络 Au ...

  4. Linux 网络编程基础(1)--网络相关的数据结构及转化函数

    在Linux下进行网络编程,使用的语言一般为C.就个人感受而言,在Linux下进行网络程序的编写,重要的不是代码能力要多强,而是对Linux的网络编程思想的理解和对Linux网络数据结构的掌握.如果想 ...

  5. Radio Checkbox Select 操作

    一个小总结 <!DOCTYPE html> <html> <head> <meta name="description" content= ...

  6. npm使用教程(未完)

    npm docs 设置镜像站 因为npmjs的官方网站,总会下载比较慢或打不开,所以通常需要设置一下镜像站来更好的安装npm库 npm install --registry http://regist ...

  7. sqlite 查询数据 不用回调

    int main( void ){    sqlite3 *db=NULL;    char *zErrMsg = 0;    int rc;    //打开数据库连接    rc = sqlite3 ...

  8. adb server is out of date. killing... ADB server didn't ACK * failed to star

    The connection to adb is down, and a severe error has occured. [-- :: - HelloOPone] You must restart ...

  9. hdu 4497 GCD and LCM(2013 ACM-ICPC吉林通化全国邀请赛——题目重现)

    质分解 + 简单计数.当时去比赛的时候太年轻了...这道题都没敢想.现在回过头来做了一下,发现挺简单的,当时没做这道题真是挺遗憾的.这道题就是把lcm  / gcd 质分解,统计每个质因子的个数,然后 ...

  10. HDU1046:Gridland

    Problem Description For years, computer scientists have been trying to find efficient solutions to d ...