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"));
          }
相关推荐
IT小白杨5 分钟前
市场调研的自动化访问,怎样控制节奏才不被误判?
运维·经验分享·安全·自动化·指纹浏览器
Zhou1411361 小时前
Docker_03_DockerCompose多容器编排
运维·docker·容器
shdkfbbv1 小时前
【无标题】
linux·运维·服务器
周洲08302 小时前
STM32片内Flash读写深度详解|掉电参数保存、底层原理
linux·前端·stm32
shimly1234562 小时前
比 find + grep 更好用的 nm + addr2line
linux
迷途之人不知返2 小时前
【进程控制】-3-进程等待
linux
_upupup3 小时前
包管理器和vim
linux·服务器
ESDWAN3 小时前
SD-WAN 企业选型与落地指南:从链路测试到网络架构设计
运维·网络·架构
一颗小树x3 小时前
NVIDIA 驱动故障排查实录:内核升级导致 nvidia-smi 失效
linux·服务器·nvidia驱动·启动失败·内核升级
啊哈一半醒3 小时前
Docker 底层知识:从 Namespace 到 UnionFS
运维·docker·容器