当前位置: 技术问答>linux和unix
一个makefile问题,知道的告诉我,谢谢
来源: 互联网 发布时间:2015-08-13
本文导语: 我建立了一个 power.c的程序 include double compute(double x, double y); int main() { float x,y; printf("The program takes x and y from stdin and displays.n"); printf("Enter number x:"); scanf("%f", &x); printf("Ent...
我建立了一个 power.c的程序
include
double compute(double x, double y);
int main()
{
float x,y;
printf("The program takes x and y from stdin and displays.n");
printf("Enter number x:");
scanf("%f", &x);
printf("Enter number y:");
scanf("%f", &y);
printf("x^y is :%6.3fn", compute(x, y));
}
然后建立一个compute.c的文件
#include
double compute(double x, double y)
{
return (pow((double) x,(double)y));
}
编译和运行都正常
然后通过vi makefile,建立一个makefile文件如下
power: power.o compute.o
gcc -o power power.o compute.o
power.o: power.c
gcc -c power.c
compute.o: compute.c
gcc -c compute.c
保存后,运行make makefile为什么提示makefile:3: *** missing separator. Stop.
请问是什么问题?
include
double compute(double x, double y);
int main()
{
float x,y;
printf("The program takes x and y from stdin and displays.n");
printf("Enter number x:");
scanf("%f", &x);
printf("Enter number y:");
scanf("%f", &y);
printf("x^y is :%6.3fn", compute(x, y));
}
然后建立一个compute.c的文件
#include
double compute(double x, double y)
{
return (pow((double) x,(double)y));
}
编译和运行都正常
然后通过vi makefile,建立一个makefile文件如下
power: power.o compute.o
gcc -o power power.o compute.o
power.o: power.c
gcc -c power.c
compute.o: compute.c
gcc -c compute.c
保存后,运行make makefile为什么提示makefile:3: *** missing separator. Stop.
请问是什么问题?
|
power: power.o compute.o
gcc -o power power.o compute.o //--->最前面是Tab键吗?
gcc -o power power.o compute.o //--->最前面是Tab键吗?
|
Makefile文件中,每个命令行必须用TAB键产生的空白。这是规定!
missing separator已经提示你了!
missing separator已经提示你了!