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"));
          }
相关推荐
viqjeee1 天前
Linux ALSA驱动详解
linux·运维·服务器·alsa
夜未央311 天前
HTTPS 原理与 PHP 文件包含及伪协议详解
运维·服务器·安全·网络安全
云川之下1 天前
【网络】变长子网划分 (VLSM) 示例、点到点网络
运维·服务器·网络·变长子网
Dovis(誓平步青云)1 天前
《epoll深度解析:从原理到使用,解锁Linux高并发I/O的核心能力(终篇)》
linux·运维·服务器·网络
不会kao代码的小王1 天前
服务器、存储与网络核心知识全解析
运维·服务器·网络
Xの哲學1 天前
Linux Workqueue 深度剖析: 从设计哲学到实战应用
linux·服务器·网络·算法·边缘计算
nix.gnehc1 天前
Anolis23 环境下 Docker 与私有 Harbor 仓库完整部署指南
运维·docker·容器
xiep14383335101 天前
Ubuntu 24.04.3 LTS 搭建离线仓库安装docker-ce
linux·ubuntu·docker
物理与数学1 天前
linux 内存区域(Zone)
linux·linux内核
代码游侠1 天前
学习笔记——ARM Cortex-A 裸机开发实战指南
linux·运维·开发语言·前端·arm开发·笔记