Make error "Makefile:xx: *** missing separator. Stop."

huangapple go评论56阅读模式
英文:

Make error "Makefile:xx: *** missing separator. Stop."

问题

目前,我正在尝试编译Info-Zip的Unzip程序,因为我无法在任何地方找到适用于Windows的可执行文件,所以决定尝试使用他们提供的源代码进行编译。在通过Chocolatey下载了make之后,我运行了构建源代码的命令:make。但是它在第47行给我报错:

PS C:\Users\User\Downloads\unzip60\unzip60> make
Makefile:47: *** missing separator.  Stop.

这是Makefile的那一部分(从第47行开始):

!IFNDEF debug
NODEBUG=1
!ENDIF

我删除了这一部分,因为似乎不需要它,因为它似乎是一些我不需要的选项开关,但它最终导致了其他类似行的错误。

有人能告诉我为什么会显示此错误以及如何修复吗?我在Google上查找了一下,它说与缩进有关,但我不确定。

(注意:我没有编写这个makefile,我是从互联网上获取的)

无论如何,这是文件的链接,如果有人需要参考:https://pastebin.com/LzE9ua2J

英文:

Currently, I am trying to compile the program Unzip by Info-Zip as I can't find binaries for Windows anywhere so I decided to try to compile it with the source code they provided. After downloading make through Chocolatey, I ran the command to build the source code: make. Anyway it gave me an error on the 47th line

PS C:\Users\User\Downloads\unzip60\unzip60> make
Makefile:47: *** missing separator.  Stop.

Here is that segment of the Makefile (starting at the 47th line)

!IFNDEF debug
NODEBUG=1
!ENDIF

I deleted that segment as it seems like it wasn't needed since it seemed like some option switches I didn't need, but it ended up throwing that error for other similar lines as well.

Could someone tell me why it is showing this error and how to fix it? I Googled it up and it says it has something to do with indents but I'm not sure.

(Note: I didn't write this makefile as I got it from the Internet)

Anyway here is the file if someone needs it for reference: https://pastebin.com/LzE9ua2J

答案1

得分: 1

!IFNDEF这种带有感叹号的语法看起来像是Microsoft的nmake语法。你正试图使用GNU make,它使用不同的语法

如果你不需要这些部分,可以尝试删除它们。但是nmakemake之间可能存在其他语法差异。因此,要么使用nmake,正如makefile的作者所期望的那样,要么重写makefile以使用正确的语法。

英文:

The syntax with exclamation mark !IFNDEF looks like Microsoft's nmake syntax. You are trying to use GNU make, which uses different syntax.

If you don't need these parts, you can try deleting them. But there might be other syntax differences between nmake and make. So, either use nmake, as the author of the makefile intended, or rewrite the makefile to use proper syntax.

huangapple
  • 本文由 发表于 2023年7月3日 21:32:33
  • 转载请务必保留本文链接:https://go.coder-hub.com/76605237.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定