您的位置:首页 > 移动开发 > Objective-C

操作系统学习笔记(5)--makefile文件实例

2010-05-23 00:01 375 查看
Makefile文件的实例应用

 

test.c

 

#include "stdio.h"
#include "test.h"

int main() {

printf("this is a test. /n");
PAUSE(1000);
printf("this is second test. /n");
KASSERT(1==1);
printf("this is 3 test. /n");

}


 

test.h

#define PAUSE(count)			/
do {					/
unsigned long i;				/
for (i = 0; i < (count); ++i)	/
;				/
} while (0)

#define KASSERT(cond) 					/
do {							/
if (!(cond)) {	/
printf("test /n");				/
while (1)					/
; 						/
}							/
} while (0)


 

Makefile

#targets : prerequisites
#             command
#             ...
#
object : test.c test.h
gcc -o object test.c

clean :
rm -f object


 

 

 

 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  makefile object