10

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?

muru
  • 193,181
  • 53
  • 473
  • 722
user3144605
  • 203
  • 1
  • 3
  • 5

1 Answers1

18

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.

Rinzwind
  • 293,910
  • 41
  • 570
  • 710
  • maybe add the link to https://www.gnu.org/software/make/manual/html_node/Error-Messages.html#Error-Messages to help rank the manual up in web search engines ;) – Wolf Dec 09 '19 at 14:35