Error Codes Wiki

Makefile Missing Separator Error — Tab vs Spaces Indentation Issue

Informationalcommand

Overview

Fix the 'missing separator' error in Makefiles caused by using spaces instead of tabs for recipe indentation, which is required by make syntax.

Key Details

  • Make requires recipe lines (commands under targets) to be indented with a tab character, not spaces
  • The 'missing separator' error on a specific line means that line uses spaces instead of a tab
  • This is one of the most common Makefile errors for developers new to make
  • Modern editors may be configured to insert spaces when Tab is pressed, causing this error
  • The tab requirement is a historical artifact from make's creation in 1976

Common Causes

  • Editor configured to insert spaces instead of tabs (expandtab in vim, insertSpaces in VS Code)
  • Copied Makefile content from a website that converted tabs to spaces
  • Git or diff tool replaced tabs with spaces during merge or patch application
  • IDE reformatter applied space-based indentation to the Makefile

Steps

  1. 1Identify the error line from the error message: 'Makefile:LINE: *** missing separator. Stop.'
  2. 2Replace spaces with a tab on that line — use the literal Tab key or your editor's tab character
  3. 3Configure your editor for Makefiles: VS Code: add 'makefile' to insertSpaces: false in settings
  4. 4Show whitespace in your editor to visually distinguish tabs from spaces
  5. 5Use 'cat -A Makefile' to see tabs (shown as ^I) vs spaces in the file

Tags

makefilemissing-separatortabindentationbuild

More in Command

Frequently Asked Questions

It is a historical design decision from 1976 when make was created. The author, Stuart Feldman, chose tabs to distinguish recipe lines from other content. He later admitted it was a mistake but changing it would break compatibility.