我如何处理makefile(gnu make)中的多个文件,以及:
- 为每个文件运行一个命令或一系列命令
- 在大于零的单个错误代码上失败
- 无需在 makefile 中键入每个文件名
- 即使在第一次失败后继续在所有文件上运行
我想出了这个。它可以工作,除了最后一个要求,并且非常unMake:
.PHONY: lint
.PHONY: all
all: lint
lint:
for f in `find src/ -name \*.inc -o -name \*.html`; do php -l $$f && continue || exit 1; done