Makefile variable assignment

来源:互联网 发布:radiohead 知乎 编辑:程序博客网 时间:2024/04/30 07:27

Makefile variable assignment

What is the difference between :

VARIABLE = value

VARIABLE ?= value

VARIABLE := value

VARIABLE += value

1>VARIABLE = value

Normal setting of a variable - values within it are recursively expanded when the variable is used, not when it's declared

2> VARIABLE := value

Setting of a variable with simple expansion of the values inside - values within it are expanded at declaration time.

3> VARIABLE ?= value

Setting of a variable only if it doesn't have a value

3> VARIABLE += value

Appending the supplied value to the existing value

原创粉丝点击