【发布时间】:2011-10-25 13:36:43
【问题描述】:
在这一行:
GCCVER:=$(shell a=`mktemp` && echo $'#include <stdio.h>\nmain() {printf("%u.%u\\n", __GNUC__, __GNUC_MINOR__);}' | gcc -o "$a" -xc -; "$a"; rm "$a")
我明白了:
*** unterminated call to function `shell': missing `)'. Stop.
我愚蠢的迂回变量有什么问题?
更新0
$ make --version
GNU Make 3.81
$ bash --version
GNU bash, version 4.2.8(1)-release (x86_64-pc-linux-gnu)
$ uname -a
Linux 2.6.38-10-generic #46-Ubuntu SMP x86_64 GNU/Linux
$ gcc --version
gcc (Ubuntu/Linaro 4.5.2-8ubuntu4) 4.5.2
【问题讨论】:
-
顺便说一句,
$(shell gcc -v 2>&1 | tail -1 | awk '{print $$3}')有什么问题? -
@reinierpost:除了我不知道之外什么都没有。
标签: shell gcc makefile gnu-make variable-expansion