makefile查找文件是否存在,不存在才拷贝;

来源:互联网 发布:r230搓纸轮 淘宝 编辑:程序博客网 时间:2024/04/29 03:52

linux配置程序时,经常需要设置配置文件。程序更新时,配置文件不需要替换,只有第一次部署时才拷贝。

脚本如下:

file =  /etc/1.conf

ifeq ($(file), $(wildcard $(file)))
@echo  1.conf exist
else
cp 1.conf $(etc_dir)
endif



0 0
原创粉丝点击