Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Make error: missing separator

Tags:

makefile

People also ask

What does missing separator in Makefile mean?

Means that the makefile contains spaces instead of Tab's. The make utility is notoriously picky about the use of Space instead of Tab . So it's likely that the makefile contains Space at the beginning of rule stanzas within the file.


As indicated in the online manual, the most common cause for that error is that lines are indented with spaces when make expects tab characters.

Correct

target: 
\tcmd

where \t is TAB (U+0009)

Wrong

target:
....cmd

where each . represents a SPACE (U+0020).


Just for grins, and in case somebody else runs into a similar error:

I got the infamous "missing separator" error because I had invoked a rule defining a function as

($eval $(call function,args))

rather than

$(eval $(call function,args))

i.e. ($ rather than $(.


This is a syntax error in your Makefile. It's quite hard to be more specific than that, without seeing the file itself, or relevant portion(s) thereof.


For me, the problem was that I had some end-of-line # ... comments embedded within a define ... endef multi-line variable definition. Removing the comments made the problem go away.


My error was on a variable declaration line with a multi-line extension. I have a trailing space after the "\" which made that an invalid line continuation.

MY_VAR = \
   val1 \ <-- 0x20 there caused the error.
   val2

In my case error caused next. I've tried to execute commands globally i.e outside of any target.

UPD. To run command globally one must be properly formed. For example command

ln -sf ../../user/curl/$SRC_NAME ./$SRC_NAME

would become:

$(shell ln -sf ../../user/curl/$(SRC_NAME) ./$(SRC_NAME))

In my case, I was actually missing a tab in between ifeq and the command on the next line. No spaces were there to begin with.

ifeq ($(wildcard $DIR_FILE), )
cd $FOLDER; cp -f $DIR_FILE.tpl $DIR_FILE.xs;
endif

Should have been:

ifeq ($(wildcard $DIR_FILE), )
<tab>cd $FOLDER; cp -f $DIR_FILE.tpl $DIR_FILE.xs;
endif

Note the <tab> is an actual tab character