makefile简单介绍
来源:互联网 发布:mac的手绘软件 编辑:程序博客网 时间:2024/04/29 20:32
◆ make可被用来维护,更新和重新生成计算机程序组。
◆ 对于由大量程序模块所构成项目,其用途更为明显,它能够简化目标文件或可执行程序的生成过程,有助于用户模块化地、一致性地编译程序。
◆ 只有当一个目标有相关文件是比目标更新的时候,它才被更新,所以能提高效率。
可方便地维护多个文件生成的文档。
二:描述文件
[目的名列表]: [依赖列表]
[TAB]命令(组)
[TAB]命令(组)
……
备注:
1 目的名(或列表)必须写在每行行首(可以用空格开头),且后必须跟冒号,多个目的名之间空格分开,表明一系列各自独立的目的是用相同的依赖列表和规则生成的。
2 依赖列表必须紧跟在冒号之后,可缺省。
3 TAB开始的后续行作为命令行,它组成了规则。同一行的多个命令用分号;隔开。注意,TAB不能用空格代替。
4 冒号: 是目的列表终结符,它标志着目的列表的结束。跟在冒号之后的依赖列表将被添加到目的的依赖关系集中。
5 注释用#号和换行号所包围。
例子:将test1,test2,test3做成一个makefile文件,用test调用测试,
***************test1.c************
#include "stdio.h"
void test1()
{
printf("test1/n");
}
***************test2.c************
#include "stdio.h"
void test2()
{
printf("test2/n");
}
***************test3.c************
#include "stdio.h"
void test3()
{
printf("test3/n");
}
***************test.c************
#include "stdio.h"
void main()
{
test1();
test2();
test3();
}
***************makefile************
相当于控制编译执行过程,按以下顺序执行
test: test.o test1.o test2.o test3.o
cc test.o test1.o test2.o test3.o -o test
test.o: test.c
cc -c test.c
test1.o: test.c
cc -c test1.c
test2.o: test.c
cc -c test2.c
test3.o: test.c
cc -c test3.c
执行:1.make
2 ./test
- makefile简单介绍
- [Android Makefile] 简单介绍
- linux makefile简单介绍
- makefile简单介绍
- makefile简单介绍
- makefile简单介绍
- makefile简单介绍
- Makefile的简单介绍
- Makefile简单介绍
- automake 生成 makefile 简单介绍
- 如何自己编写Makefile(简单介绍)
- Makefile介绍
- makefile 介绍
- Makefile介绍
- makefile 介绍
- Makefile介绍
- makefile介绍
- Makefile 介绍
- 如何扩展Struts(1)
- 1.2 Flex简介
- 1.3 MXML
- tet
- ResourceManager
- makefile简单介绍
- 读资源文件
- 1.4 ActionScript
- ETM 数据分析
- 1.5 Flex的事件机制
- 公布一些常用的WebServices,希望对大家的应用有帮助~
- 1.6 使用Adobe Flex Builder
- code point
- 定时器与多线程 SetTimer and Multi-Thread 每个线程独立使用一个定时器