Makefile的call函数
来源:互联网 发布:阿里订单打印软件 编辑:程序博客网 时间:2024/05/03 06:54
写了个例子来研究Makefile的call函数:
#define a multiline variabledefine target echo $@echo $@endef#define the target which is the first target, so default targetall:$(call target,all)#define the second target, we must explicitly make itclean:$(call target,clean)#declare that all and clean are phony targets.PHONY: all clean
执行make或make all的结果是:
echo allallecho allall
执行make clean的结果是:
echo cleancleanecho cleanclean
其实源代码可以这么写的:
#define a multiline variabledefine target echo $@echo $@endef#define the target which is the first target, so default targetall:$(call target)#define the second target, we must explicitly make itclean:$(call target)#declare that all and clean are phony targets.PHONY: all clean
结果跟上面一样。
小结:Makefile中的第一个目标是最终目标,是make默认执行的目标,call函数会以此调用多行变量的每一个(此处是make命令,所以会被执行了)。然后$@自动化变量在make执行是会被赋值为当前的目标。
- Makefile的call函数
- Makefile的call函数
- Makefile的call函数
- Makefile call 等 常用的函数
- makefile中的call函数
- makefile eval函数和call函数 讲解
- Makefile九之foreach,if,call函数
- js的call函数
- call函数的来源
- makefile详解 函数 foreach if call origin shell
- 跟我一起写Makefile(12)--- 函数(字符串函数+文件名操作函数+foreach+if+call+origin+shell+控制make的函数)
- JavaScript call函数的用法
- js 的 apply / call 函数
- JavaScript Call()函数的总结
- 函数的apply、call方法
- js的call函数"源码"
- makefile的函数
- Makefile的函数调用
- C\C++的转义字符
- 我对个人5S管理读书笔记
- 循环左移数组
- linux设备驱动归纳总结(四):4.单CPU下竞态和并发
- 设计模式之策略模式——“要怎么做,到时候再说”
- Makefile的call函数
- linux设备驱动归纳总结(四):5.SMP下的竞态和并发
- Java 枚举7常见种用法(转自:http://www.iteye.com/topic/1116193)
- linux设备驱动归纳总结(五):1.在内核空间分配内存
- warning: the frame size of 1040 bytes is larger than 1024 bytes
- CListCtrl类
- uva 10054 The Necklace 拼项链 欧拉回路基础应用
- linux设备驱动归纳总结(五):2.操作硬件——IO内存
- linux设备驱动归纳总结(五):3.IO静态映射