Linux: shell: bash: Makefile:5: *** missing separator. Stop.

如果从网上找这个的原因可能会找到一堆

https://til.linyiru.com/2018/04/make/missing-separator/

但是如果真的要看原因,就需要看make的文档或者是源代码。

比如源代码里有这么一段:

c 复制代码
@item missing separator.  Stop.
@itemx missing separator (did you mean TAB instead of 8 spaces?).  Stop.
This means that @code{make} could not understand much of anything
about the makefile line it just read.  GNU @code{make} looks for
various separators (@code{:}, @code{=}, recipe prefix characters,
etc.) to indicate what kind of line it's parsing.  This message means
it couldn't find a valid one.

#: src/read.c:1154
#, c-format
msgid "missing separator (did you mean TAB instead of 8 spaces?)"
msgstr "分隔符缺失 (你大概想用 TAB,而不是八个空格)"

#: src/read.c:1156
#, c-format
msgid "missing separator"
msgstr "缺失分隔符"

源代码,如果一行的开始多几个空格,就可能导致make读到EOL。因为前几个都是无意义的字符:空格。

c 复制代码
        /* If the word we're looking at is EOL, see if there's _anything_
           on the line.  If not, a variable expanded to nothing, so ignore
           it.  If so, we can't parse this line so punt.  */
        if (wtype == w_eol)
          {
            if (*p2 == '\0')
              continue;

            /* There's no need to be ivory-tower about this: check for
               one of the most common bugs found in makefiles...  */
            if (cmd_prefix == '\t' && strneq (line, "        ", 8))
              O (fatal, fstart, _("missing separator (did you mean TAB instead of 8 spaces?)"));
            else
              O (fatal, fstart, _("missing separator"));
          }
相关推荐
云和数据.ChenGuang几秒前
Zabbix 6 与 PHP 5 版本**完全不兼容
运维·开发语言·php·zabbix·运维工程师
fufu03111 分钟前
Linux环境下的C语言编程(四十一)
linux·c语言·算法
深圳安锐科技有限公司3 分钟前
隧道变形监测 变焦视觉非接触式 自动化分析 远程管理省心
运维·自动化·实时监测·隧道监测·自动化监测·结构健康监测
电气铺二表姐1377441661511 分钟前
从并网到离网,尽在掌握:分布式储能微网智能监控与能量管理系统
运维·分布式·物联网·能源
测试人社区—小叶子27 分钟前
接口测试全攻略:从Swagger到MockServer
运维·c++·人工智能·测试工具·机器人·自动化·测试用例
zfxwasaboy28 分钟前
BUG: failure at drivers/pci/msi.c:376/free_msi_irqs()!
linux·c语言·bug
文军的烹饪实验室28 分钟前
【无标题】unix:///tmp/supervisor.sock no such file
linux·运维·unix
ricky_fan30 分钟前
(25年12月)claude code报错:might not be available in your country
macos·bash
yscript31 分钟前
GPU分配BUG: Duplicate GPU detected : rank 1 and rank 0 both on CUDA device d5000
linux·运维·服务器·vscode·bug
Watermelo61738 分钟前
【简单快速】windows中docker数据如何从C盘迁移到其他盘
java·运维·docker·容器·运维开发·devops·空间计算