makefile 实例一
来源:互联网 发布:魔兽世界编程宝典 pdf 编辑:程序博客网 时间:2024/06/06 00:27
工程目录
TEST/Makefile
TEST/main/main.c
TEST/count/hjs_count.c
TEST/count/hjs_count.h
TEST/print/hjs_print.c
TEST/print/hjs_print.h
main.c
main()
{
hjs_count(2);
hjs_printf(3);
}
hjs_count.c
#include"stdio.h"
int hjs_count(int a)
{
for (a = 1; a < 10; a++)
a = a +2;
printf("value of a is %d\n",a);
return 0;
}
hjs_count.h
int hjs_count(int a);
hjs_print.c
#include"stdio.h"
int hjs_printf(int a)
{
printf("the value is %d",a);
return 0;
}
hjs_print.h
int hjs_printf(int a)
Makefile
all: main.o hjs_count.o hjs_print.o
gcc -o test main.o hjs_count.o hjs_print.o
main.o:./main/main.c
gcc -c ./main/main.c
hjs_count.o:./count/hjs_count.c
gcc -c ./count/hjs_count.c
hjs_print.o:./print/hjs_print.c
gcc -c ./print/hjs_print.c
clean:
rm -rf main.o hjs_count.o hjs_print.o test
- makefile 实例一
- makefile使用实例(一)
- Makefile实例
- Makefile实例
- makefile实例
- makefile实例
- makefile实例
- Makefile实例
- makefile实例
- Makefile实例
- Makefile实例
- makefile实例
- Makefile实例
- makefile实例
- Makefile实例
- GNU Makefile学习专题(一) | 第一个实例
- 从简单实例开始,学会写Makefile(一)
- 简单的实例,多层嵌套Makefile(一)
- Android -- 重写按键事件的注意事项
- 程序员必知8大排序
- 预编译 头文件 stdafx.h
- 这个人很懒
- C++ Virtual详解
- makefile 实例一
- 静or动态库中的全局变量被不同的dll调用修改,其值是否独立?
- android完全退出程序 (所有版本通用)
- Android apk系列1-------APK签名
- 程序员面试题精选100题(10)-排序数组中和为给定值的两个数字[算法]
- CMap 集合类使用
- Android Mms 数据库
- VC++ GetLastError
- m2-Maven编译遇到的不支持注释问题