码迷,mamicode.com
首页 > 其他好文 > 详细

gnu make

时间:2016-04-18 22:04:15      阅读:129      评论:0      收藏:0      [点我收藏+]

标签:

  http://stackoverflow.com/questions/448910/makefile-variable-assignment

 更加全面的介绍 http://blog.csdn.net/ruglcc/article/details/7814546/

Lazy Set

VARIABLE = value

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

Immediate Set

VARIABLE := value

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

Set If Absent

VARIABLE ?= value

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

Append

VARIABLE += value

Appending the supplied value to the existing value (or setting to that value if the variable didn‘t exist)

 

 

还有一个在“嵌套执行”中比较有用的参数,“-w”或是“--print-directory”会在make的过程中输出一些信息,让你看到目前的工作目录。比如,如果我们的下级make目录是“/home/hchen/gnu/make”,如果我们使用“make -w”来执行,那么当进入该目录时,我们会看到:

      make: Entering directory `/home/hchen/gnu/make‘.

而在完成下层make后离开目录时,我们会看到:   

   make: Leaving directory `/home/hchen/gnu/make‘

当你使用“-C”参数来指定make下层Makefile时,“-w”会被自动打开的。如果参数中有“-s”(“--slient”)或是“--no-print-directory”,那么,“-w”总是失效的。

 

gnu make

标签:

原文地址:http://www.cnblogs.com/luolizhi/p/5405720.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!