linux - Makefile 缺少分隔符

标签 linux makefile autotools

我现在在使用 autotools 生成的 Makefile 时遇到问题,它最初看起来像 this .当我尝试 make 时出现错误:

Makefile:327: *** missing separator.  Stop.

然后,我尝试了以下更改:

326,327c326
< LDFLAGS = -Wl,-O1,--sort-common,--as-needed,-z,relro -L/home/tjm/tmp/fake-root/libgd/usr/local/lib/ -L /home/tjm/tmp/fake-root/libpng/usr/local/lib -L /home/tjm/tmp/fake-root/freetype/usr/local/lib -L /home/tjm/tmp/fake-root/libpng/usr/local/lib -L /home/tjm/tmp/jpeg-6b
<     -static
---
> LDFLAGS = -Wl,-O1,--sort-common,--as-needed,-z,relro -L/home/tjm/tmp/fake-root/libgd/usr/local/lib/ -L /home/tjm/tmp/fake-root/libpng/usr/local/lib -L /home/tjm/tmp/fake-root/freetype/usr/local/lib -L /home/tjm/tmp/fake-root/libpng/usr/local/lib -L /home/tjm/tmp/jpeg-6b -static

但是,这一次,我得到了这个错误:

Making all in intl
Makefile:35: *** missing separator.  Stop.
make[1]: *** [Makefile:582: all-recursive] Error 1
make: *** [Makefile:489: all] Error 2

相关行如下所示:

32   skip_next=no; \
33   strip_trailopt () \
34   { \
35     flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
36   }; \

还有很多事情,比如:

34 { flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; }; \

34   { \
35     flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; }; \

33   strip_trailopt () { flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; }; \

 35 ^Iflg=printf '%s\n' "$$flg" | sed "s/$$1.*$$//"; \$ 

还是报同样的错

有谁能给我一些关于如何修复它的 ieda 吗?

最佳答案

(注意:我不确定这在 StackOverflow 和 SuperUser 中是否正确。)

如果您编辑了 Makefile,它将不会有用,因为它只会从 Makefile.in 中重新生成,而那个反过来将是从 Makefile.am 中生成。

检查您的Makefile.am 文件,并将-static 与其他所有内容放在同一行;发生的事情是它在上一行 (\) 的末尾没有继续符号,因此变量定义不会继续。正因为如此,它试图将其作为规则进行解析,但事实并非如此。

关于linux - Makefile 缺少分隔符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39683299/

相关文章:

linux - x86 ASM Linux - 使用 .bss 部分

linux - 按特定文件夹和扩展名递归复制

path - 在makefile中指定路径(在Windows上为GNU make)

linux - 便利库中的符号未在可执行文件中导出

linux - 在关联文件中增加新版本的版本号(文档)

c++ - 使用 Automake 进行单元测试

linux - 如何将 Case 与 shift 结合起来并将结果添加到 bash 的列表中

linux - 在 bash 脚本中控制光标

makefile - Makefile-仅当文件不存在时才进行依赖

makefile - 将 '$(VAR)' 回显到文件