kaxa46
kaxa46

Reputation: 19

I got this C make file error when i'm doing make

Hello i'm working and got this C make file error when i'm doing make

Make file:12: *** missing separator. Stop.

thanks.

#
#
#
CC=gcc
CFLAGS=-Wall


all : count
.PHONY : all

count : main.o get.o
       $(CC) $(CFLAGS) -o count main.o get.o


main.o : main.c
        $(CC) $(CFLAGS) -c -o main.o main.c

get.o : get.c
       $(CC) $(CFLAGS) -c -o get.o get.c


debug:clean get.c main.c 
        gcc -Wall -g -o test get.c main.c
        gdb -tui test

.PHONY: clean
clean : 
        rm -rf *.o

Upvotes: 0

Views: 107

Answers (1)

MrFthiz
MrFthiz

Reputation: 144

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.\

Just change your spaces to tabs.

On VS Code, just click the "Space: 4" on the downright corner and change it to tab when editing your Makefile.

Upvotes: 1

Related Questions