在 GNU make 中,可以做一些事情,比如X:=$(shell command -v foo)
将 X 设置为该 shell 命令的输出。有没有办法用纯 POSIX make 实现同样的事情?
There is no way in POSIX yet. There is a proposal which is probably going to be accepted at some point which allows for a !=
assignment which is similar to using $(shell ...)
. Newer versions of GNU make already support this syntax, as does BSD make.
X != command -v foo
Run Code Online (Sandbox Code Playgroud)