Makefile中调用shell常见问题
来源:互联网 发布:淘宝c店不给发票会处罚 编辑:程序博客网 时间:2024/04/29 02:38
简单记录这这几天写程序Makefile.am文件遇到的两个问题,以后有遇到再补充
1. 调用的shell语句需要使用shell变量
在makefile文件里变量名用$符号来标识,形如$(var)或者${var},当变量名为一个字符时,也可以写为$v,当我们要使用的shell要使用shell变量时,要用$$来标识,
如shell 命令为:
cat /etc/redhat_release |awk '{print $2}'
在makefile里的写法则为:
$(shell cat /etc/redhat_release |awk '{print $$2}')
2. 当调用的shell命令中有小括号字符时
shell命令如:
cat /etc/redhat-release | awk -F '(' '{print $1}'
在Makefile里的写法应为:
${shell cat /etc/redhat-release | awk -F '(' '{print $$1}'}
具体原因不清楚,没有找到相关的资料,如果仍按之前的写法则出现如下错误:
Makefile:2: *** unterminated call to function `shell': missing `)'. Stop.
0 0
- Makefile中调用shell常见问题
- makefile 中调用shell脚本注意事项
- makefile中的shell调用---注意事项
- Makefile中shell必知必会
- makefile 中制定shell
- Makefile中使用Shell
- shell中调用shell
- Makefile中使用shell注意事项
- Makefile中使用shell实例
- Makefile中执行shell脚本
- 在makefile中执行shell
- makefile中使用shell 命令
- Makefile中添加shell脚本
- makefile 和shell文件相互调用
- Makefile里调用shell注意点
- makefile 和shell文件相互调用
- makefile 和shell文件相互调用
- makefile 和shell文件相互调用
- CCF之网络延时(java)
- MySQL 如何存储长度很长的数据字段
- OpenCV4Android使用OpenCV无需安装OpenCV Manager方法
- 【备忘】传智播客第五期视频教程(5-8月)IOS视频教程下载
- .vimrc
- Makefile中调用shell常见问题
- C++解决最大子列和问题,算法时间复杂度优化
- Linux下对拍
- JAVA蓝桥杯(2)字符串的简单处理
- [Leetcode] #62#63 Unique Paths I & II
- Caffe for Python 官方教程(翻译) ----我的第一个caffe程序
- CODEVS 1068 乌龟棋
- iptables相关教
- LintCode 29-交叉字符串