Make error: missing separator
Solution 1
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
).
Solution 2
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 $(
.
Solution 3
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.
Solution 4
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.
Solution 5
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
Related videos on Youtube

Comments
-
Wesley Reed over 1 year
I am getting the following error running
make
:Makefile:168: *** missing separator. Stop.
What is causing this?
-
S.S. Anne about 3 yearsDoes this answer your question? makefile:4: *** missing separator. Stop
-
-
user35443 almost 7 yearsWhat? :) I guess you didn't have
0x20
"space" there, is that correct? -
smac89 over 6 years@user35443 The placement of
$
-
aseq over 6 yearsYou can use .RECIPEPREFIX to change the character make uses. See: gnu.org/software/make/manual/html_node/…
-
ynn over 3 yearsThank you. I didn't know comments in
define
directive are treated literally. Actually the behavior is not explain in the documentation. (For clarity: Embedding a number sign#
within the directive isn't itself a syntax error. But it is just not interpreted as a start of a comment, so doing that is admittedly error-prone.) -
Teodor Hirs over 2 yearscompletely not understandable answer, not applicable to the question in any way
-
Tejas Shetty over 1 yearPlease elaborate
-
cpurdy about 1 yearTo confirm, I just ran into this myself. Most editors/IDEs can help spot this. For example, in IDEA, go to the View menu, choose "Active Editor", "Show Whitespaces". I can't believe that spaces vs. tabs is still a thing in (checks notes) 2022.