生成文件:4:***遗漏分隔符。停止 [英] makefile:4: *** missing separator. Stop
本文介绍了生成文件:4:***遗漏分隔符。停止的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这是我的生成文件:
all:ll
ll:ll.c
gcc -c -Wall -Werror -02 c.c ll.c -o ll $@ $<
clean :
\rm -fr ll
当我尝试使清洁
或使化妆
,我得到这个错误:
When I try to make clean
or make make
, I get this error:
:makefile:4: *** missing separator. Stop.
我怎样才能解决这个问题?
How can I fix it?
推荐答案
makefile文件有标签一个非常愚蠢的关系,每一个规则的所有操作都通过标签识别......和4号位不要让一个标签,只有一个标签,使标签...
makefile has a very stupid relation with tabs , all actions of every rule are identified by tabs ...... and No 4 spaces dont make a tab , only a tab makes a tab...
要检查我用命令猫-e -t -v makefile_name
它显示了^ I制表符和行结束与$的presence都是以确保正确依赖结束生命和标签标记为规则的行动,使他们很容易辨认的make工具... ..
it shows the presence of tabs with ^I and line endings with $ both are vital to ensure that dependencies end properly and tabs mark the action for the rules so that they are easily identifiable to the make utility.....
例如:
Kaizen ~/so_test $ cat -e -t -v mk.t
all:ll$ ## here the $ is end of line ...
$
ll:ll.c $
^Igcc -c -Wall -Werror -02 c.c ll.c -o ll $@ $<$
## the ^I above means a tab was there before the action part, so this lines ok .
$
clean :$
\rm -fr ll$
## see here there is no ^I which means , tab is not present ....
## in this case you need to open the file again and edit/ensure a tab
## starts the action part
希望这有助于!
这篇关于生成文件:4:***遗漏分隔符。停止的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文