Makefile三个有用变量$@,$^,$<
$@:目标文件
$^:所有的依赖文件
$<:第一个依赖文件
使用上面三个变量就可以简化我们的Makefile文件:
#简化后的Makefile
main : main.o log.o test_log.o
gcc –o $@ $^
main.o : main.c log.h test_log.h
gcc –c $<
log.o : log.c log.h
gcc –c $<
test_log.o : test_log.c test_log.h
gcc –c $<
.PHONY : clean
clean :
rm *.o main
随机推荐
- Android布局
android:gravity="center" android:orientation="vertical" android:orientation=&quo ...
- POJ 2891 Strange Way to Express Integers(拓展欧几里得)
Description Elina is reading a book written by Rujia Liu, which introduces a strange way to express ...
- asp.net MVC实现文章的上一篇下一篇
由于这个东西的原理没有什么难的(只是实现的时候有少量的坑),故直接上代码以便查阅.另:本文给出的Action附送了点击量统计. public ActionResult SingleNews(int? ...
- WITH AS的含义
一.WITH AS的含义WITH AS短语,也叫做子查询部分(subquery factoring),可以让你做很多事情,定义一个SQL片断,该SQL片断会被整个SQL语句所用到.有的时候,是为了让S ...
- visual Sdudio 快捷键
项目相关的快捷键 Ctrl + Shift + B = 生成项目 Ctrl + Alt + L = 显示Solution Explorer(解决方案资源管理器) Shift + Alt+ C = 添加 ...
- html5 Web Storage(localStorage(),sessionStorage())
Web Storage包括了两种存储方式:sessionStorage和localStorage sessionStorage 是会话级别的存储,这些数据只有在同一个会话中的页面才能访问并且当会话结束 ...
- IsBackground的理解
1.当在主线程中创建了一个线程,那么该线程的IsBackground默认是设置为FALSE的. 2.当主线程退出的时候,IsBackground=FALSE的线程还会继续执行下去,直到线程执行结束. ...
- 用NULL布局为什么不能显示
import javax.swing.JComboBox;import javax.swing.JFrame;import javax.swing.JLabel;import javax.swing. ...
- Windows下WebStorm使用SVN
安装了phpstorm之后,想配置svn,结果在file->settings->Version Contorl->subversion->use conmand line cl ...
- Jquery 复习练习(01)
Jquery 复习练习 window.onload = function() {} == $(function() {}); 千万注意:js对象和jq对象的区别,这也是常常犯的错误 js对象举例: w ...