下面以\build\core\product.mk下面的内容为例介绍:
<span style="font-size:14px;">define _find-android-products-files $(shell test -d device && finddevice -maxdepth 6 -name AndroidProducts.mk) \ $(shell test -d vendor && find vendor -maxdepth 6 -nameAndroidProducts.mk) \ $(SRC_TARGET_DIR)/product/AndroidProducts.mk endef</span>
makefile文件中如出现一些相同的命令序列,可为这些相同的序列定义一个变量,不能和makefile文件中的变量重名,这里是_find-Android-products-files,定义这种命令序列的语法以define开始,以endef结束。
命令包的使用,就像使用变量一样:
<span style="font-size:14px;">define get-all-product-makefiles $(call get-product-makefiles,$(_find-android-products-files)) endef</span>
$(_find-android-products-files),用$来使用命令包,就像使用函数和变量一样
这里call是函数名,get-product-makefiles和$(_find-android-products-files)是函数的参数
感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!
您可能感兴趣的文章:
- linux中无make命令的问题(make: *** 没有指明目标并且找不到 makefile及make命令安装方法)
- 一天一个shell命令 linux文本系列-file命令用法
- Linux执行可执行文件提示No such file or directory的解决方法
- Linux下环境变量配置方法小结(.bash_profile和.bashrc的区别)
- Linux中文件描述符fd与文件指针FILE*互相转换实例解析
- Linux makefile 和shell文件相互调用实例详解
- Linux file命令的使用
声明:本站(华域联盟www.cnhackhy.com)所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。

评论(0)