我们在编写完makefile,然后在终端中
$make
出现“makefile:2: *** 遗漏分隔符 。 停止。”问题,原因是在编写makefile文件时:
all:
gcc -o helloworld helloworld.c
fresh:
rm -rf Makefile
clean:
rm -rf helloworld helloworld.o
install:
cp helloworld /usr/bin
uninstall:
rm -rf /usr/bin/helloworld
gcc、rm、cp前面是tab分割符,不能用空格,否则会出现:
“makefile:2: *** 遗漏分隔符 。 停止。”
“makefile:4: *** 遗漏分隔符 。 停止。”
“makefile:6: *** 遗漏分隔符 。 停止。”
“makefile:8: *** 遗漏分隔符 。 停止。”
“makefile:10: *** 遗漏分隔符 。 停止。”
这样的错误提示。
$make
出现“makefile:2: *** 遗漏分隔符 。 停止。”问题,原因是在编写makefile文件时:
all:
gcc -o helloworld helloworld.c
fresh:
rm -rf Makefile
clean:
rm -rf helloworld helloworld.o
install:
cp helloworld /usr/bin
uninstall:
rm -rf /usr/bin/helloworld
gcc、rm、cp前面是tab分割符,不能用空格,否则会出现:
“makefile:2: *** 遗漏分隔符 。 停止。”
“makefile:4: *** 遗漏分隔符 。 停止。”
“makefile:6: *** 遗漏分隔符 。 停止。”
“makefile:8: *** 遗漏分隔符 。 停止。”
“makefile:10: *** 遗漏分隔符 。 停止。”
这样的错误提示。
本文介绍了一种常见的Makefile编写错误——使用空格代替Tab键作为分隔符所导致的问题,并给出了正确的编写方式。
7281

被折叠的 条评论
为什么被折叠?



