我有一个包含另一个 makefile 的 Makefile,比如 CommonMakefile。有一个变量,我想用一个值作为前缀(参见附加 using +=
),保持其余值不变。
V = value1 # set in CommonMakefile that is included
V = value0 $(V) # I want to prefix value0 to V
# rule defined in CommonMakefile that is included
whatsV:
echo $V # first char is a <TAB> here
我怎样才能做到这一点?
期待:
$ gmake whatsV
value0 value1
实际的:
$ gmake whatsV
Makefile:3: *** Recursive variable `V' references itself (eventually). Stop.
PS:我不能/不想更改 CommonMakefile。