主题 : 问两条makekfile命令的意思~ 复制链接 | 浏览器收藏 | 打印
级别: 新手上路
UID: 2047
精华: 0
发帖: 10
金钱: 95 两
威望: 10 点
综合积分: 20 分
注册时间: 2008-10-21
最后登录: 2011-09-25
楼主  发表于: 2008-12-06 11:18

 问两条makekfile命令的意思~

@$(MKCONFIG)
$(@:_config) arm
这里的@$(target)和$(@:text) text不太明白,麻烦解释一下@$(target)和@:分别是什么意思
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
1楼  发表于: 2008-12-06 19:40
那是Makefile里面的变量$@的展开的一种应用 

比如
smdk2410_config : unconfig
@$(MKCONFIG) $(@:_config=) arm arm920t smdk2410 NULL s3c24x0


展开来就是
@$(MKCONFIG) smdk2410 arm arm920t smdk2410 NULL s3c24x0
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."