Makefile:4: *** missing separator. Stop. How to fix it
Codemia Knowledge Hub ·
make stops with makefile:4: *** missing separator. Stop. when line 4 breaks Makefile syntax, almost always because a recipe line starts with spaces instead of a tab. Replace the leading spaces on that line with a single real tab character.
What make expects on that line
A Makefile is a set of rules, each made of:
- A target: the file
makecreates or updates. - Prerequisites: the input files used to build the target.
- A recipe: the commands
makeruns to build the target.
The basic syntax:
[TAB] stands for a literal tab character, which must start every recipe command. The error appears when the tab is missing, replaced by spaces, or the rule is otherwise malformed. The number after makefile: is the line where make found the problem.
Causes and fixes
- Spaces instead of a tab: the most common cause. Start recipe lines with a tab.
- Inconsistent indentation: use only tab characters before recipes.
- Whitespace-only lines: a line with only spaces or tabs and no command can be misread by
make.
Broken example:
The gcc line is indented with spaces, which triggers the error.
Fixed version:
Replace [TAB] with an actual tab character in your Makefile.
Preventing it in your editor
Configure your editor or IDE to insert tabs rather than spaces in Makefiles. You can also run make -n (or make --just-print) to print the commands that would run without executing them, which helps spot problems.
Quick reference
| Issue Description | Solution |
| Spaces used instead of tabs | Replace spaces with a tab |
| Misaligned text in recipes | Ensure all commands in recipes are tabbed |
| Missing recipe commands | Add the necessary command after the target |
Related reading
- Making your .NET language step correctly in the debugger
- MalformedXML The XML you provided was not well-formed or did not validate against our published schema
- Manifest merger failed uses-sdkminSdkVersion 14
- Manifest Merger failed with multiple errors in Android Studio
- Manually change the status of a job to successful in kubernetes
- Marsheling issue while replication cache in ehcache
- Mask-RCNN with Keras Tried to convert 'shape' to a tensor and failed. Error None values not supported
- matplotlib error - no module named tkinter
.png&w=3840&q=75)
Tackling System Design Interview Problems
A short course that equips you with the skills to approach system design interviews methodically.
Start the free courseNo course covers this one yet
Basis Lab writes one for you from a sentence about what you want to be able to do, then teaches it and checks you understood. Your first course is free.
Build my courseInterview Questions practice on Codemia
Over 11,000 interview practice questions for 300+ companies, searchable by company and role.