我在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
答案 0 :(得分:0)
如果您只想打印某些规则的东西,请使用info函数...
$(info $(app))
答案 1 :(得分:0)
您不能在外壳程序调用中有意义地放置一个Makefile函数调用。我想你真的只是在寻找
build:
tbd run apps \
| sed 's/\[//;s/\]//' \
| xargs -n 1 bsd start