【发布时间】:2018-12-15 17:41:53
【问题描述】:
我正在使用 GNU Make 3.81。以下 makefile 可以正常工作:
name=lucas
all: test
.PHONY: test
test:
echo $(name) # outputs variable correctly
但是当我尝试使用“define”指令定义变量时,它停止工作:
define name =
lucas
endef
all: test
.PHONY: test
test:
echo $(name)
为什么第二个版本不起作用?谢谢。
编辑:找到this related thread。好像是版本问题。 = 符号显然仅在 3.82 版之后才在定义语句中被识别。
【问题讨论】:
标签: bash shell makefile gnu-make