/errors/make/missing-separator
make: Makefile:2: *** missing separator. Stop.
The commands on this page have not been executed by our verification runner yet.updated 2026-10-20
- tool
- Make
- exit code
- 2
- versions
- GNU make 3.82+, GNU make 4.x
- os
- any
Every command in a Makefile rule, the recipe, must start with a tab character. When a recipe line starts with spaces, GNU make cannot tell what the line is and stops:
Makefile:2: *** missing separator. Stop.2 is the line number. GNU make 4 adds a hint when the line starts with eight spaces: *** missing separator (did you mean TAB instead of 8 spaces?). Stop.
Find and fix space-indented lines
grep -nP '^ +' Makefile # lines starting with spaces
cat -A Makefile | grep -n '^ ' # cat -A shows tabs as ^I
sed -i -E 's/^ {4}/\t/' Makefile # replace 4 leading spaces with a tab (check the result)A correct rule, with a tab before $(CC):
app: main.c
$(CC) -o app main.cKeep editors from converting tabs
" ~/.vimrc
autocmd FileType make setlocal noexpandtab"[makefile]": { "editor.insertSpaces": false }No tabs at all
.RECIPEPREFIX = >
app: main.c
> $(CC) -o app main.cSources
Related pages
errors · cmakeCMake: Could not find a package configuration file provided by "Foo"find_package(Foo REQUIRED) fails when CMake finds neither FindFoo.cmake nor FooConfig.cmake. Install the dev package, or point CMAKE_PREFIX_PATH at it.config · vscodeVS Code format on save: editor.formatOnSave and default formattersTurn on editor.formatOnSave in VS Code, choose the formatter for each language with editor.defaultFormatter, and share the setup in .vscode/settings.json.compare · vimVim vs Neovim: what differs and which to chooseNeovim is a Vim fork with Lua configuration, a built-in LSP client, Tree-sitter and modern defaults; Vim keeps Vim9 script and maximum compatibility. Compared.