ifeq (test.txt, $(wildcard test.txt))
# do something
endif
shell脚本方式
IsExist = $(shell if [ -f test.txt ]; then echo "true"; else echo "false"; fi;)
ifeq (IsExist, true) #noted that no quotation marks around true
# do something
endif
Makefile或mk判断文件是否存在的解决方法原生方式ifeq (test.txt, $(wildcard test.txt))# do somethingendifshell脚本方式IsExist = $(shell if [ -f test.txt ]; then echo "true"; else echo "false"; fi;)ifeq (IsExist, true) #noted that no quotation marks around true# do som