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

参考: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. 安装爬虫scrapy

    使用easy_install安装scrapy,报错 error: Setup script exited with error: command 'gcc' failed with exit stat ...

  2. 使用jquery控制display属性

    //隐藏 $("#id").css('display','none'); //显示 $("#id").css('display','block'); 或 $(& ...

  3. 【LeetCode题意分析&解答】34. Search for a Range

    Given a sorted array of integers, find the starting and ending position of a given target value. You ...

  4. [LeetCode]题解(python):142-Linked List Cycle II

    题目来源: https://leetcode.com/problems/linked-list-cycle-ii/ 题意分析: 给定一个链表,如果链表有环,返回环的起始位置,否则返回NULL.要求常量 ...

  5. 测试scanf输入含非法控制符

    心得: 学到scanf命令时第一个想到的就是可以利用scanf做一个十进制转16进制.八进制的小程序,很天真的以为也可以转二进制,在搜索字符控制符的时候才知道原来没有二进制的控制字符,需要换算出来得出 ...

  6. Eclips入门教程

    1. 插件推荐 Eclipse默认情况下是一个纯净版的,所以功能简单,而开源IDE最为强大的莫过于各种插件,通过使用插件可以帮助我们减少大量编写代码的工作量,也帮助我们降低了编写代码的难度,所以懂得安 ...

  7. WA(Write Amplification)写入放大

    WA是闪存及SSD相关的一个极为重要的属性.由于闪存必须先擦除才能再写入的特性,在执行这些操作时,数据都会被移动超过1次.这些重复的操作不单会增加写入的数据量,还会减少闪存的寿命,更吃光闪存的可用带宽 ...

  8. Java泛型的一点用法(转)

    1.一个优秀的泛型,建议不要这样写public static <K, V> Map<K, V> getMap(String source, String firstSplit, ...

  9. xsoup,Jsoup

    Xsoup 0.2.0 Xsoup 的详细介绍:请点这里 Xsoup 的下载地址:请点这里 https://github.com/code4craft/xsoup http://www.oschina ...

  10. BZOJ 4503 两个串(FFT)

    [题目链接] http://www.lydsy.com/JudgeOnline/problem.php?id=4503 [题目大意] 给出S串和T串,计算T在S中出现次数,T中有通配符'?'. [题解 ...