Make Error: 'missing separator. Stop.' — Cause, Fix, and Troubleshooting Guide
Fix Makefile:10: *** missing separator. Stop. — recipe lines must start with a TAB, not spaces. Diagnose with cat -A and convert leading spaces back to tabs.
- #automation
- #troubleshooting
- #make
Fixing errors like this? Get 500 free DevOps AI prompts
500 copy-paste AI prompts for the stack you actually run — one PDF, free.
Overview
Makefile:10: *** missing separator. Stop. is make’s most notorious gotcha: recipe lines under a target must begin with a literal TAB character, and make found something else — usually spaces — where it expected that tab. The “separator” it is missing is the tab that introduces a command line.
Almost always the cause is invisible: an editor, a paste, or an autoformatter converted the leading tab into spaces. The file looks perfectly indented on screen because a tab and eight spaces render identically, but make treats them as completely different. Make requires the tab specifically; spaces at the start of a recipe line are a syntax error.
A second, less common trigger is stray text that make cannot parse as a rule, variable assignment, or directive — for example a wrapped line or a misplaced continuation.
You will see the error naming the exact line:
$ make build
Makefile:10: *** missing separator. Stop.
Symptoms
Makefile:<line>: *** missing separator. Stop.with a specific line number.- The Makefile “looks correctly indented” in your editor.
- Copy-pasting a Makefile from a web page, chat, or PDF breaks it immediately.
- Reformatting the file, running a “convert tabs to spaces” command, or
.editorconfigwithindent_style = spaceintroduced the failure. cat -Ashows leading spaces (^-nothing / literal spaces) where recipe lines should show^I.
Common Root Causes
1. Recipe line indented with spaces instead of a tab
The dominant cause. The line under a target starts with spaces, so make refuses it.
cat -A Makefile | sed -n '8,11p'
build:$
gcc -c app.c$
gcc -o app app.o$
$
Those leading blanks are spaces (shown literally), not ^I. A correct recipe line looks like this instead:
build:$
^Igcc -c app.c$
^I is cat -A’s rendering of a tab.
2. Editor configured to expand tabs
An editor set to “insert spaces for tabs”, or a project .editorconfig with indent_style = space, silently converts every tab you type into spaces in the Makefile.
grep -A3 -i 'makefile\|\*' .editorconfig 2>/dev/null
[*]
indent_style = space
indent_size = 2
3. Pasted from a source that stripped tabs
Copying from a browser, Slack, a PDF, or a code block that normalized whitespace replaces tabs with spaces. The paste looks fine but every recipe line is now broken.
4. Stray or unparseable text outside a rule
A line that is neither a rule, a variable assignment, a comment, nor a directive — such as a broken line continuation or leftover prose — also produces missing separator because make cannot classify it.
Makefile:14: *** missing separator. Stop.
sed -n '14p' Makefile
this line is not a valid make construct
How to Diagnose
Step 1 — Go straight to the reported line and reveal whitespace. cat -A makes tabs and line ends visible.
cat -A Makefile | sed -n '9,11p'
gcc -c app.c$
Leading spaces (not ^I) at the start of a recipe line is the smoking gun.
Step 2 — Find every recipe-looking line that starts with spaces instead of a tab across the whole file:
grep -nP '^ +\S' Makefile
10: gcc -c app.c
11: gcc -o app app.o
Every line listed is a candidate for the error.
Step 3 — Confirm which lines correctly use tabs so you know the file’s intended style:
grep -nP '^\t' Makefile | head
If this returns nothing, the whole file lost its tabs.
Step 4 — For the “stray text” variant, print the exact reported line and check it is a valid construct (rule, assignment, .PHONY, include, etc.):
sed -n '14p' Makefile | cat -A
Fixes
Convert leading spaces on recipe lines back to a single tab. For a file that uses 8-space “tabs”:
sed -i 's/^ /\t/' Makefile # 8 leading spaces -> one tab
Or, more robustly, use unexpand to turn runs of leading blanks into tabs:
unexpand --first-only -t 4 Makefile > Makefile.fixed && mv Makefile.fixed Makefile
Verify the result:
cat -A Makefile | sed -n '9,11p'
build:$
^Igcc -c app.c$
^Igcc -o app app.o$
Insert a literal tab in your editor. In vim, use Ctrl-V then Tab to enter a real tab; disable expandtab for Makefiles:
autocmd FileType make setlocal noexpandtab
Protect Makefiles in .editorconfig so tools stop expanding tabs:
[Makefile]
indent_style = tab
[{Makefile,*.mk}]
indent_style = tab
Change the recipe prefix if you cannot use tabs (GNU make 3.82+). .RECIPEPREFIX lets you use another character instead of tab:
.RECIPEPREFIX := >
build:
> gcc -c app.c
> gcc -o app app.o
Remove or fix stray text for the non-tab variant — delete the unparseable line or turn it into a comment (#) or a proper construct.
What to Watch Out For
- A tab and spaces look identical on screen. When a Makefile mysteriously breaks,
cat -A(or:set listin vim) first — never trust the visual indentation. - Only the leading whitespace of recipe lines must be a tab. Variable assignments,
ifeqblocks, and comments use spaces normally; do not tab-indent those. - Web pages, chat apps, and PDFs strip tabs on copy. After pasting a Makefile, run
grep -nP '^ +\S'before running make. .editorconfigand “format on save” are the silent repeat offenders — pinindent_style = tabforMakefileand*.mkin every repo..RECIPEPREFIXis a per-Makefile escape hatch, not a fix for a corrupted file; if collaborators expect tabs, converting the whitespace is cleaner than changing the prefix.
Related Guides
- Make Error: ‘No rule to make target’
- Make Error: ’*** [Makefile:42: build] Error 1’
- Generating Makefiles and Justfiles for Repeatable Ops Tasks
Fixed it? Get 500 Automation & DevOps AI prompts — free
500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.
- 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
- Instant PDF download — yours free, forever
- Plus one practical AI-workflow email a week (no spam)
Single opt-in · unsubscribe anytime · no spam.
Did this fix your issue?
Get 500 Battle-Tested DevOps AI Prompts — Free
500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.
- 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
- Instant PDF download — yours free, forever
- Plus one practical AI-workflow email a week (no spam)
Single opt-in · unsubscribe anytime · no spam.