首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 操作系统 > UNIXLINUX >

makefile变量高级用法的有关问题

2012-03-26 
makefile变量高级用法的问题makefile如下:ifdef do_sortfunc : sortelsefunc : stripendifbar : b d c

makefile变量高级用法的问题
makefile如下:

ifdef do_sort
func := sort
else
func := strip
endif

bar := b d c a e
foo := $($(func) $(bar)) #注意这句

des :
  echo $(foo)

打印结果:
echo

问题:为什么foo的值为空呢?单独打印func的值和bar的值没有问题。

[解决办法]
foo := $(shell $(func) $(bar))

热点排行