makefile:4: *** missing separator. Stop
make defines a tab is required to start each recipe. All actions of every rule are identified by tabs. If you prefer to prefix your recipes with a character other than tab, you can set the .RECIPEPREFIX variable to an alternate character.
To check, I use the command cat -e -t -v makefile_name
.
It shows the presence of tabs with ^I
and line endings with $
. Both are vital to ensure that dependencies end properly and tabs mark the action for the rules so that they are easily identifiable to the make utility.
Example:
Kaizen ~/so_test $ cat -e -t -v mk.t
all:ll$ ## here the $ is end of line ...
$
ll:ll.c $
^Igcc -c -Wall -Werror -02 c.c ll.c -o ll $@ $<$
## the ^I above means a tab was there before the action part, so this line is ok .
$
clean :$
\rm -fr ll$
## see here there is no ^I which means , tab is not present ....
## in this case you need to open the file again and edit/ensure a tab
## starts the action part
Makefile:1: *** missing separator. Stop
It's a tabs problem. Some text editors may replace tabs with white spaces, make sure you use a proper text editor that doesn't mess it up. Open your makefile in vi or any other rudimentary editor, and rewrite that makefile.
Note that after each target rule, one single tab must be placed in the beginning of the line. Everything that comes after that tab is passed on to the shell (there can be more tabs, spaces, and whatever you want, but keep in mind that there must be a tab in the beginning of the line).
Error in make command makefile:18: *** missing separator. Stop
Line 18 is gcc -fPIC -g -c -Wall mymemory.cpp
. Make is expecting a separator, typically :
. It's not detecting this line as a command. You mistyped the intendation: you have spaces where you should have a tab.
Good editors highlight makefile lines that begin with spaces but look like they should begin with a tab instead.
Errors in make file : *** missing separator. Stop
You can find an explanation of this error in Appendix B Errors Generated by Make.
Every line in a recipe must begin with a tab character. The recipes starting with $(C++)
and $(CC)
near the top of your file do not seem to start with a tab character.
Additionally, the section
INCLUDE = \
-I./usr/include/sys
-I./Headers \
seems to be missing a backslash after sys
and that same section (and many more) have superfluous empty lines.
Makefile:12: *** missing separator. Stop. gfortran
Inspired by an answer relating to gedit
I opened Sublime Text> Preferences > Settings
and added "Makefile" to "file_exclude_patterns":
After that, I opened it I gedit and actually converted spaces to tabs.
Voila things worked.
Related Topics
Let Non-Root User Write to Linux Host in Docker
Errors in Make File:*** Missing Separator. Stop
Strange Return Value "134" to Call Gawk in a Bash Script
Bash Scripting - Read Single Keystroke Including Special Keys Enter and Space
How to Protect My Process from Being Killed
Linux Socket Using Multiple Threads to Send
What Happens When a Signal Is Received While Already in a Signal Handler
How to Debug the Linux Kernel with Qemu and Kgdb
Jmeter - Could Not Find the Testplan Class
Wrong Payload When Using Bluez Stack as Peripheral
What Does "Typedef _U16 _Bitwise _Le16;" Mean in Linux Kernel
Alsa Cannot Set Sample Format[Ffmpeg]
Using Linux Cut, Sort and Uniq
Fast Way to Find Difference Between Two Strings of Equal Length in Perl