This is my makefile:
all:ll
ll:ll.c
gcc -c -Wall -Werror -02 c.c ll.c -o ll $@ $<
clean :
\rm -fr ll
When I try to make clean
or make make
, I get this error:
:makefile:4: *** missing separator. Stop.
How can I fix it?
cmakefile
This is my makefile:
all:ll
ll:ll.c
gcc -c -Wall -Werror -02 c.c ll.c -o ll $@ $<
clean :
\rm -fr ll
When I try to make clean
or make make
, I get this error:
:makefile:4: *** missing separator. Stop.
How can I fix it?
Best Answer
make has a very stupid relationship with tabs. All actions of every rule are identified by tabs. And, no, four spaces don't make a tab. Only a tab makes a tab.
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: