|
发表于 2004-5-21 23:56:04
|
显示全部楼层
[code:1]
test_sum.c:
int sum(int a,int b)
{
return a+b;
}
test_sum.h
int sum(int,int);
test_main.c:
#include "test_sum.h"
main()
{
int a,b,c;
...
c=sum(a,b);
...
}
[/code:1]
Makefile:
all: sum
sum: test_sum.o test_main.o
gcc -o sum test_sum.o test_main.o
test_sum.o: test_sum.c test_sum.h
gcc -c test_sum.o
test_main.o: test_main.c
gcc -c test_main.c
没测试,自己试试吧,我建议你先补补c吧,这么简单的东西都。。。。。 |
|