在make中(我正在使用OpenBSD的实现,但我认为这个问题也与GNU相关),我们有以下所谓的局部变量% The name of theprefix of the file, containing only the file portion, no suffix or preceding directory components
(大致来自makeFreeBSD中的手册说这些更长的版本是首选的。OpenBSD的手册页面没有提到这样的事情,但
我还有另一个规则something-all,它需要运行something,将VAR设置为vars中的每个值。echo $(VAR)
$(foreach VAR,$(vars),something)noob@work:~/Desktop$ makesomething-allmake: something: No such file or directory
make: *** [something-all