以下规则清除makefile中的所有二进制文件不起作用。makefile中的bash内建命令
SHELL:=bash
PHONY: clean
clean:
for file in {"greedy","mario","pset1_mario","credit","hello"}; do \
[[ -e "${file}" ]] && rm ${file}; \
done
它给出了以下错误信息。
recipe for target 'clean' failed make: *** [clean] Error 1
如果我使用make文件中的相同命令调用另一个shell脚本,它将起作用。
clean:
bash ./cleanup.sh
有没有办法将这些命令放入makefile文件本身?
您需要两个变量的美元符号:'$$ {file}'在该上下文中。 – lurker