Search code examples
cmakefilegnu-make

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


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


Solution

  • 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.