What does the error “makefile missing separator” mean and how can it be fixed?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This error generally means that your makefile’s indentation isn’t correct, usually needing a tab where there is a space. To fix it, ensure that lines in your rules section begin with a tab, not spaces.
This classic error is usually encountered when using make, a utility for automatically building executable programs. The infamous “missing separator” message typically means you’ve used spaces instead of a tab character for indentation in your Makefile.
Now, let’s address this by following these steps:
1. Open your Makefile in a text editor.
2. Go to the line number mentioned in the error message (if provided).
3. The beginning of that line must start with a TAB character, not spaces. ‘Make’ is notoriously fussy about this, believe it or not.
4. Replace any spaces at the beginning of that line with a TAB.
5. You must do this for every rule in the Makefile. Each command must be indented with a TAB.
And there it’s fixed! Next time, ensure you’re using tabs instead of spaces in your Makefile to avoid this error. Make demands it…literally!
This error is typically seen while executing a ‘make’ command and it points to an error in the Makefile format. One of the peculiar things about Makefile is that it requires tab indentation, not spaces, for command lines following the target line. If you use spaces instead of a tab, you’ll get the “makefile missing separator” error. So the solution is as simple as replacing those spaces with a tab.
Now, don’t get me wrong, Makefiles are a powerful tool, but having such a strict syntax requirement feels quite antiquated in the age of modern coding practices. There are lots of programming languages and scripting tools that don’t care whether you use tabs or spaces. So why should Makefile syntax be so strict about it? It’s a controversial opinion, but perhaps the GNU make utility could benefit from updating to be more user friendly, especially for new users who may not be familiar with its quirks.
But one man’s bug is another man’s feature, I suppose. Some people may argue that it’s this strict syntax that makes Makefile dependable and efficient. Yet, to me, dealing with an issue like a “missing separator” error due to what seems to be a minor formatting quirk feels more like a hassle than a help.
The “makefile missing separator” error usually indicate that there’s wrong formatting in your makefile. This is typically because makefile expecting a tab character as a separator, but it found a space character somewhere. To fix it, you should ensures that each command is precede with a tab, not spaces.