Makefile的call函数
来源:互联网 发布:淘宝新赛欧改折叠钥匙 编辑:程序博客网 时间:2024/05/16 14:33
写了个例子来研究Makefile的call函数:
- #define a multiline variable
- define target
- echo $@
- echo $@
- endef
- #define the target which is the first target, so default target
- all:
- $(call target,all)
- #define the second target, we must explicitly make it
- clean:
- $(call target,clean)
- #declare that all and clean are phony targets
- .PHONY: all clean
执行make或make all的结果是:
- echo all //因为Makefile默认会显示每条命令,所以echo $@这条命令语句也会显示出来,如果不想显示,前面加@
- all
- echo all
- all
执行make clean的结果是:
- echo clean
- clean
- echo clean
- clean
其实源代码可以这么写的:
- #define a multiline variable
- define target
- echo $@
- echo $@
- endef
- #define the target which is the first target, so default target
- all:
- $(call target)
- #define the second target, we must explicitly make it
- clean:
- $(call target)
- #declare that all and clean are phony targets
- .PHONY: all clean
结果跟上面一样。
小结:Makefile中的第一个目标是最终目标,是make默认执行的目标,call函数会以此调用多行变量的每一个(此处是make命令,所以会被执行了)。然后$@自动化变量在make执行是会被赋值为当前的目标。
0 0
- 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的函数调用
- iOS 中KVC、KVO、NSNotification、delegate 总结及区别
- equals与==之间的区别
- JAVA设计模式之观察者模式
- No1.Two Sum
- Session 和Cookie的区别
- Makefile的call函数
- 面向对象
- java 获取泛型的类型
- 经典迷宫问题
- 关于ConcurrentHashMap
- 用Eclipse进行Java web开发时,错误:HttpServlet was not found on the Java
- HDU 1495 非常可乐(隐式图的遍历)
- 关于System V 消息队列介绍
- 修身养性的句子_关于修身养性的名言