三、makefile 之echo \ $^ exec
来源:互联网 发布:阿里云域名使用方法 编辑:程序博客网 时间:2024/06/05 02:45
首先基于上篇文章makefile 的初认识,我们继续学习makefile 新东西(hello.cpp test.h文件和上文类同不在细谈)着重学习makefile;
mkdir -p testcd testmkdir functiontouch hello.cppvi hello.cppmkdir sourcetouch test.hvi test.hcd ..touch makefilevi makefile
同样建立操做和三个文件
#include<iostream>using namespace std;void print(){cout<<"i am a student"<<endl;}
test.h文件
#include"../function/test.h"#include<iostream>using namespace std;int main(int argc,char* argv[]){cout<<"hello world"<<endl;print();return 0;}
hello.cpp文件
VPATH=./sourceCC=g++#vpath %.cpp source#vpath %.h functionobject=hello.o hello:$(object) @ echo 正在编译文件 $< $(CC) -o $@ -g $^$(object):hello.cpp @ echo 正在编译文件 \$< $(CC) -o \$@ \-c $^ exec: cd /home/ubuntu/test;pwd #ubuntu为本机用户名clean: -rm hello $(object)
上面是新的makefile文件
这里简单说一下,
@ echo 信息 代表打印输出的信息,同时若一行语句写不完,可以使用\换行输入,命令和打印信息都是可以的;
当执行make exec 的时候,make 或解析到/home/ubuntu/test目录下执行一些特殊的操作 这里只是使用了pwd命令 打印出路径,当然用户可以使用其他命令完成自己特定操作;
0 0
- 三、makefile 之echo \ $^ exec
- Linux之Makefile (三)
- makefile杂谈之三
- makefile总结之三
- Makefile之三
- SHELL十三问之三:别人 echo、你也 echo ,是问 echo 知多少?
- Shell十三问之三:别人echo、你也echo ,是问echo知多少
- makefile 中echo 颜色
- makefile echo方法
- Makefile 中 echo 和@echo的区别
- Makefile (三)之 命令书写
- Windows Driver Samples剖析之Echo (三)
- makefile @echo 命令回显
- 内核makefile echo-cmd表达式
- contiki2.6之Makefile详细解读三
- Makefile基础三之书写规则
- Makefile和shell的区别:echo和@echo
- Makefile和shell的区别:echo和@echo
- tiny6410关闭看门狗
- javaScript基本数据类型
- 求二叉排序树的最小根
- 【Algothrim】Christmas Gifts
- ccf 排队问题
- 三、makefile 之echo \ $^ exec
- <教程>-扁平化
- CSS3D
- AngularJS 深入理解 $scope
- select2点击空白处不消失
- kaggle中的可视化(一):House Prices
- CSS样式排版
- 关于unity build后的unity_builtin_extra很大的问题
- 微信小程序之绑定点击事件