Missing Separator in Makefile

Missing Separator in Makefile

I have next code in Makefile:

CFLAGS=-Wall -g

clean:
    rm -f ex1

When I run "make clean" I receive next error: Makefile:4: * missing separator. Stop.

Why? How I can fix it?

1 Answer

You have spaces where you should need a tab (and no: 4 spaces do not equal a tab).

This will show tabs (shown as ^I) and spaces:

 cat -e -t -v {Makefile}

4th line:

1 CFLAGS=-Wall -g
2 
3 clean:
4     rm -f ex1

Remove the spaces in front of rm and make it a tab.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Sarah Jenkins
Author

Sarah Jenkins

Sarah Jenkins is a veteran tech journalist with over 12 years of experience covering artificial intelligence, mobile innovations, and digital ethics. Her insights have appeared in leading technology publications worldwide.