In Linux, various packages can only be used for building and compiling source codes. More specifically, the “make” command does such an operation by compiling different program pieces dependent on each other. It is a simple process and takes much less time than traditional source code compiling methods. On some occasions, the users reported the error “Makefile: *** Missing Separator,” which usually occurs due to spacing issues.
This guide explains:
- What are the Reasons for the Error Makefile: *** Missing Separator?
- How to Fix Makefile: *** Missing Separator?
What are the Reasons for the Error Makefile: *** Missing Separator?
The error “Makefile: *** Missing Separator” usually occurs when there are indentation issues. For example, if you are writing a Makefile and have put hard space, which calls for the error. This sounds a bit off, but it is what it is.
Here, you should use the “tab” button to indent as the simple spaces generated using the “space” key are nothing but the whitespace, which is one of the major reasons for the error. More on the official documentation can be read here.
How to Fix Makefile: *** Missing Separator?
The syntax error is usually responsible for the error “Makefile: *** Missing Separator”, so to resolve it, fix the syntax errors first. These errors are mostly in indentation, so the vim editor offers a whitespace filtering feature to fix them.
To use it, open up the file using the vim editor in this way:
$ vim file1.txt
Note: This is dummy text, and real data could be different.
Once the file is opened, press “Shift + :” to enter the INSERT MODE. Now, type “syntax on” and press the Enter key:
Then, again, press the “Shift + :” key to enter the Insert mode, and enter “set syntax =whitespace” and it will show you all the white spaces you need to remove:
The above image shows the whitespace in “pink” while the “green” is for the tab spaces.
To fix the error Makefile: *** missing separator on Linux, the whitespaces are meant to be removed, which can be done using the vim editor. The Makefiles rely heavily on the tab spaces, often confused with the simple spaces (using the space key), and even a small mistake can cause this error. Also, ensure no stray character is present in the Makefile.
This guide shows the fix of the error Makefile: *** missing separator by filtering out the whitespaces using the vim editor.