makefile变量赋值
时间:2010-06-08 来源:skysea_hust
Makefile中的"="":="、"?="和"+="区别是:
"="是直接给变量赋值。
":="是将":="右边中包含的变量直接展开给左边的变量赋值。
"?="是在该变量没有被赋值 的情况下为其赋值。
"+="是给该变量追加值。
例:
a = 1
b = 2
c := $(a) 3
d = 4
d ?= 5
b += 6
结果:
a=1
c=1 3
d=4
b=2 6 这里有GNU make中文手册,很好:
http://www.yayu.org/book/gnu_make/index.html#content
原文:http://blog.chinaunix.net/u2/73528/showart_1085496.html
"="是直接给变量赋值。
":="是将":="右边中包含的变量直接展开给左边的变量赋值。
"?="是在该变量没有被赋值 的情况下为其赋值。
"+="是给该变量追加值。
例:
a = 1
b = 2
c := $(a) 3
d = 4
d ?= 5
b += 6
结果:
a=1
c=1 3
d=4
b=2 6 这里有GNU make中文手册,很好:
http://www.yayu.org/book/gnu_make/index.html#content
原文:http://blog.chinaunix.net/u2/73528/showart_1085496.html
相关阅读 更多 +