日期:2014-05-16  浏览次数:20605 次

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))