Reputation: 367
This is my makefile and whenever I do make or make clean I get this error : "makefile:11: * missing separator. Stop." I am pretty sure that I did it right, but not sure why this error is showing up. Its my first time dealing with this error so I have no clue how to fix it or go about it...
COMPILER = gcc
CCFLAGS = -g -Wall
CFLAGS2 = -g
all: malloc test
debug:
make DEBUG=TRUE
malloc.o: malloc.c malloc.h
$(COMPILER) $(CCFLAGS) -c malloc.c malloc.h
malloc: malloc.o
$(COMPILER) $(CCFLAGS) -o malloc malloc.o
test.o: test.c
$(COMPILER) $(CFLAGS2) -c test.c
test: malloc.o test.o
$(COMPILER) $(CCFLAGS) -o test test.o malloc.o
ifeq ($(DEBUG), TRUE)
CCFLAGS += -g
endif
clean:
rm -f malloc
rm -f *.o
rm -f test
rm -f *.o
ERROR
"makefile:11: *** missing separator. Stop."
Upvotes: 0
Views: 119
Reputation: 145899
Makefile requires you to have a tab character at the beginning of all the recipe lines.
target ... : prerequisites ...
<TAB>recipe
<TAB>...
<TAB>...
Upvotes: 3