我有一个像这样干净的PHONY的makefile:
.PHONY: clean
clean: clean_target
# Remove files created by the build process.
clean_target:
rm -rf *.mcs *.bit *.bin *.twr *.pwr *.tsi *.twx *.ncd *.pcf *.ngd *.ngc
我想排除名为“FIFO.ngc”的文件。我怎么能这样做?
感谢,
答案 0 :(得分:2)
如果你正在使用GNU make,你可以这样做:
clean_target:
rm -rf *.mcs *.bit *.bin *.twr *.pwr *.tsi *.twx *.ncd *.pcf *.ngd \
$(filter-out FIFO.ngc,$(wildcard *.ngc))
答案 1 :(得分:0)
有点冗长,但您可以从列表中删除'* .ngc'并添加另一行:
find . -type f -name '*.ngc' -not -name 'FIFO.ngc' -delete