最简单的一个makefile实例
2016-12-12 22:59
323 查看
//test.c #include <stdio.h> #include "tool.h" int main() { printf("add=%d\n",add(2,6)); return 0; }
//tool.c #include "tool.h" int add(int a,int b) { int c=a+b; return c; }
//tool.h #ifndef _TOOL_H_ #define _TOOL_H_ int add(int a,int b); #endif
Makefile
test.exe: all
gcc -o test.exe test.o tool.o
all: test.o tool.o
clean:
rm *.o
rm *.exe
然后
make
make clean即可。
相关文章推荐
- 一个简单的makefile实例
- 编写一个makefile的简单实例
- 编写一个makefile的简单实例
- 跟一个从零开始学excel vba的新手的对话过程(简单程序实例)
- 一个最简单的AJAX实例及解析
- Schema的一个简单实例
- 一个简单在jsp页面中连接sqlserver数据库的小实例
- 对一个uClinux中的Makefile文件的简单分析(ZT)
- 一个简单的SWT程序实例及详解
- 发布一个超级mini的ajax源代码(含简单实例)
- 手动建立makefile简单实例解析
- 一个响应鼠标移动的简单实例!
- 初学Attribute(一个简单实例)
- 一个简单的hibernate实例(之一)
- 一个简单的hibernate实例(之二)
- 一个简单的linux下网络程序实例-网络编程入门
- 一个简单的Makefile
- Struts学习总结(一个简单的struts实例)
- 一个最简单的Ajax实例(大部分是抄袭的)
- 最简单的一个堆栈溢出攻击实例 (2) [by Progsoft]