博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Makefile – Check if a file exists using wildcard function
阅读量:4285 次
发布时间:2019-05-27

本文共 816 字,大约阅读时间需要 2 分钟。

轉載自 

 

The following snippet of code can be used to check for the existence of a file from within a Makefile.

ifneq ("$(wildcard $(PATH_TO_FILE))","")FILE_EXISTS = 1elseFILE_EXISTS = 0endif

Quoting from make documentation.

$(wildcard 
pattern
)

The argument 
pattern is a file name pattern, typically containing

wildcard characters (as in shell file name patterns). The result of

wildcard is a space-separated list of the names of existing files

that match the pattern.

In this present case, we are not using any wildcards, but the absolute path to the file.

 

********************************************************************************************************

If file1 does not exist then $(wildcard file1) will evaluate to an empty string.

ifeq ($(wildcard file1),)     CLEAN_SRC =else     CLEAN_SRC = *.h file3endif

转载地址:http://rqsgi.baihongyu.com/

你可能感兴趣的文章
向量转置怎么求导(多元线性回归原理推导用)
查看>>
Matlab中布尔值/逻辑值与数值型类型的相互转换
查看>>
Matlab 并行代码
查看>>
matlab中的并行方法与理解(2):parfor中的变量类型
查看>>
CentOS 7 命令行模式安装teamviewer13
查看>>
teamviewer Linux centos7安装使用详细
查看>>
【MATLAB】线条标记符大小设置
查看>>
MATLAB中矩阵的逻辑索引方法
查看>>
windows下go dep环境搭建
查看>>
EMQX docker安装及运行
查看>>
使用python和MQTT.fx连接mqtt
查看>>
EMQTT的ACL鉴权(topic权限控制)
查看>>
emqx客户端用户名密码登录验证配置
查看>>
python多线程之信号量semaphore实战
查看>>
ubuntu下忘记mysql密码重置方式
查看>>
ubuntu不在python虚拟环境下使用uwsgi启动django及nginx代理配置
查看>>
flask ORM之SQLAlchemy基本架构实战
查看>>
Python2和python3中类型判断
查看>>
Centos 7上搭建flask项目实战
查看>>
搭建nginx+uwsgi+flask遇到KeyError: 'REQUEST_METHOD'
查看>>