makefile查找文件是否存在,不存在才拷贝;
linux配置程序时,经常需要设置配置文件。程序更新时,配置文件不需要替换,只有第一次部署时才拷贝。
脚本如下:
file = /etc/1.conf
ifeq ($(file), $(wildcard $(file)))
@echo 1.conf exist
else
cp 1.conf $(etc_dir)
endif
linux配置程序时,经常需要设置配置文件。程序更新时,配置文件不需要替换,只有第一次部署时才拷贝。
脚本如下:
file = /etc/1.conf
ifeq ($(file), $(wildcard $(file)))
@echo 1.conf exist
else
cp 1.conf $(etc_dir)
endif