这个简单的makefile怎么写
网上看的
第一个程序text.c
#include <stdio.h>
main()
{
int a=5;
printf("%d\n",a);
}
第二个程序run.c
#include <stdio.h>
main()
{
int ret;
ret = system("./test");
ret = (ret>>8);
printf("%d\n",ret);
}
makefile怎么写?
#makefile
xxx:text.o run.o
gcc -o xxx text.o run.o
text.o:text.c
gcc -c text.c
run.o:run.c
gcc -c run.c
为什么不行啊
程序错误?
[解决办法]
makefile看上去没问题,但gcc前要用TAB而非空格就可以了
但你的程序是有问题的,二个程序都有main,是不能生成xxx文件的