makefile下$(wildcard $^),$^,$@,$?,$<,$(@D),$(@F)代表的不同含义
2016-04-15 17:02
309 查看
$(filter-out $(PHONY) $(wildcard $^),$^)
常用用法为$(wildcard *.c)
表示列举当前目录下的所有.c文件
这里$^因为会包含依赖的文件名,如果包含的该文件存在,那么将返回其含路径的文件名
所以$(wildcard $^)就是用来过滤$^包含的所有文件并且该文件确实在本地存在.
自动化变量$?代表依赖文件列表中被改变过的所有文件。
自动化变量$^代表所有通过目录搜索得到的依赖文件的完整路径名(目录 + 一般文件名)列表。
自动化变量$@代表规则的目标。
自动化变量$<代表规则中通过目录搜索得到的依赖文件列表的第一个依赖文件。
自动化变量$(@D)
The directory part of the file name of the target,
with the trailing slash removed. If the value of ‘$@’ is dir/foo.o
then ‘$(@D)’ is dir. This value is . if ‘$@’ does not contain a slash.
http://www.gnu.org/software/make/manual/make.html
自动化变量$(@F)
The file-within-directory part of the file name of
the target. If the value of ‘$@’ is dir/foo.o then ‘$(@F)’ is foo.o.
‘$(@F)’ is equivalent to ‘$(notdir $@)’.
常用用法为$(wildcard *.c)
表示列举当前目录下的所有.c文件
这里$^因为会包含依赖的文件名,如果包含的该文件存在,那么将返回其含路径的文件名
所以$(wildcard $^)就是用来过滤$^包含的所有文件并且该文件确实在本地存在.
自动化变量$?代表依赖文件列表中被改变过的所有文件。
自动化变量$^代表所有通过目录搜索得到的依赖文件的完整路径名(目录 + 一般文件名)列表。
自动化变量$@代表规则的目标。
自动化变量$<代表规则中通过目录搜索得到的依赖文件列表的第一个依赖文件。
自动化变量$(@D)
The directory part of the file name of the target,
with the trailing slash removed. If the value of ‘$@’ is dir/foo.o
then ‘$(@D)’ is dir. This value is . if ‘$@’ does not contain a slash.
http://www.gnu.org/software/make/manual/make.html
自动化变量$(@F)
The file-within-directory part of the file name of
the target. If the value of ‘$@’ is dir/foo.o then ‘$(@F)’ is foo.o.
‘$(@F)’ is equivalent to ‘$(notdir $@)’.
相关文章推荐
- [Android]listview图文混排
- 线程同步的情景之一
- 课堂练习(数组结对开发)
- poj3481(Treap)
- MFC程序入口和执行流程
- android游戏开发(OpenGL ES绘制矩形平面)
- 第二章 数据类型
- 归并排序
- db2move 导入导出数据库
- Tomcat设置默认启动项目
- Tomcat设置默认启动项目
- appium api
- awk-2
- 在Web服务器搭建自己的Jetty服务器,并开启端口进行访问
- iOS 现有的运营商手机号正则表达式
- iOS产品发布到App Store前的准备(二)---Xcode 7 LaunchScreen.storyboard加载启动图片
- volatile 可以保证可见性,但不能保证原子性。某种意义上是线程不安全的
- 代码大全笔记
- CF 266B Queue at the School (人生第一道B题)
- HDU-1217 Arbitrage (有向图最大环[Floyd])