Chinaunix首页 | 论坛 | 博客
  • 博客访问: 500078
  • 博文数量: 104
  • 博客积分: 3045
  • 博客等级: 少校
  • 技术积分: 1230
  • 用 户 组: 普通用户
  • 注册时间: 2008-02-29 10:18
文章分类

全部博文(104)

文章存档

2011年(72)

2010年(1)

2009年(1)

2008年(30)

分类: 项目管理

2011-04-27 20:05:54

here are the rules for when elements of a makefile are expanded:
1)  For variable assignments, the lefthand side of the assignment is always expanded immediately when make reads the line during its first phase.
2) The righthand side of = and ?= are deferred until they are used in the second phase.
3) The righthand side of := is expanded immediately.
4) The righthand side of += is expanded immediately if the lefthand side was originally defined as a simple variable. Otherwise, its evaluation is deferred.
5)For macro definitions (those using define), the macro variable name is immediately expanded and the body of the macro is deferred until used.
6) For rules, the targets and prerequisites are always immediately expanded while the commands are always deferred.

Definition Expansion of a Expansion of b
a = b      Immediate      Deferred
a ?= b     Immediate      Deferred
a := b     Immediate      Immediate
a += b     Immediate      Deferred or immediate
define a   Immediate
b...
b...
b...
endef





阅读(1028) | 评论(0) | 转发(0) |
0

上一篇:Makefile 规则

下一篇:Makefile functions

给主人留下些什么吧!~~