【发布时间】:2018-10-15 11:33:51
【问题描述】:
我有以下代码在 make gnu 文件上运行
apps := $(shell tbd run apps)
apps := $(subst ],,$(subst [,,$(app)))
现在我想打印应用程序的值,我尝试了
@echo $(app)
我得到了错误
Makefile:12: *** commands commence before first target. Stop.
更新:
目前我的代码是这样的
apps := $(shell tbd run apps)
apps := $(subst ],,$(subst [,,$(apps)))
build:
@for app in $(apps) ; do \
bsd start $$app ; \
done
如果我这样尝试,我会出错
start:
apps := $(shell tbd run apps)
apps := $(subst ],,$(subst [,,$(apps)))
build:
@for app in $(apps) ; do \
bsd start $$app ; \
done
【问题讨论】:
-
@tripleee - 不一样,我尝试使用
$app(如在帖子回答中)没有成功同样的错误,知道吗? -
不是公认的答案;另一个。
-
@tripleee - 现在也试试,我没有得到错误但我仍然没有看到价值
-
@tripleee - 完成我已经更新,但问题是当我把它放在配方中时我得到了另一个错误,如果我想在其他配方中使用应用程序值,让我们这样说我应该怎么做做吗?
标签: linux shell makefile gnu-make gnu