简单makefile写法
2011-11-27 17:49
239 查看
print.h
#include<stdio.h>
void printhello();
print.c
#include"print.h"
void printhello(){
printf("helloword");
}
main.c
#include"print.h"
main()
{
printhello();
return 0;
}
makefile:
helloword:main.o print.o
gcc -o helloword main.o print.o
main.o:main.c print.h
gcc -c main.c
print.o:print.c print.h
gcc -c print.c
clean:
rm helloword main.o print.o
注意gcc之前是tab键。
#include<stdio.h>
void printhello();
print.c
#include"print.h"
void printhello(){
printf("helloword");
}
main.c
#include"print.h"
main()
{
printhello();
return 0;
}
makefile:
helloword:main.o print.o
gcc -o helloword main.o print.o
main.o:main.c print.h
gcc -c main.c
print.o:print.c print.h
gcc -c print.c
clean:
rm helloword main.o print.o
注意gcc之前是tab键。
相关文章推荐
- g++多文件编译和简单MakeFile文件写法
- 简单的makefile文件三种写法学习笔记
- linux下的Makefile文件的简单写法和简单使用
- 一个简单c++工程在linux下的makefile写法
- [zz]makefile写法简单示例
- makefile的简单写法
- Makefile最简单写法
- Makefile文件在win32Asm中应用的简单写法
- makefile写法简单示例
- makefile的简单写法
- makefile简单写法
- g++多文件编译和简单MakeFile文件写法
- linux下简单的makefile写法
- 较简单的Makefile写法
- makefile的写法
- opencv 简单的makefile
- 简单的makefile
- makefile的写法(怎么写makefile)
- 如何写简单的Makefile
- makefile的语法及写法(二)