0
对于学校项目,我尝试使用makefile。首先,我创建Makefile删除文件
install: main.c
gcc -asve-temps main.c
@if test ! -d bin/; then mkdir bin; else : fi
mv a.out $(shell pwd)/bin/
chmod 555 ./bin/a.out
的文件现在我要清除的项目:
clear:
@if test -d *.[osia]; then rm *.[osia] else : ; fi
@if test -d a.out then rm a.out; else: ; fi
执行make install精品工程。运行make clear
产生错误代码:
/bin/sh: 1: test: main.i: unexpected operator
并不会删除请求的文件。我想通过使用上面给出的模式运行make clear
目标来删除所有*.o *.s *.i and *.a
文件,以避免错误cannot remove ... : no such file or directory