1

I am getting this error when I try to run the make command.

makefile:13: *** missing separator. Stop.

my code for the make file is as follows and should be correct.

all: printname

CC = gcc

INCLUDE = .

CFLAGS= -g -Wall -ansi

printname: printname.o last.o first.o
    $(CC) -o printname printname.o last.o first.o

printname.o: printname.c
    $(CC) -I$(INCLUDE) $(CFLAGS) -c printname.c

last.o: last.c ln.h
    $(CC) -I$(INCLUDE) $(CFLAGS) -c last.c

first.o: first.c fn.h
    $(CC) -I$(INCLUDE) $(CFLAGS) -c first.c

I have looked into the problem and I am fairly certain that it is suppose to be some kind of issue with the TAB's but I have gone through the code several times to make sure that there are no rogue spaces and that it is formatted correctly. If anyone has any idea's as to what I can do to fix this that would be great! Thanks.

Mason Toy
  • 109
  • 9
  • 1
    Are you sure each `$(CC)` line (especially line 13) starts with a single tab? – Elliott Frisch Apr 07 '16 at 19:05
  • Yet... it is most likely an issue with an space or another invisible character at line 13. But it is impossible for us to know without a literal copy of the file. As it is quite short maybe you can post an hex-dump of the file. – rodrigo Apr 07 '16 at 19:05
  • I have checked several times, I opened the file up in vi and made sure there was not any extra characters from windows or anything from my OSx but I didn't see anything. As for the tab's, I am fairly sure that they are all single tabs with no spaces other than that in between I will make sure again. @Elliott Frisch – Mason Toy Apr 07 '16 at 19:09
  • Found it, turns out what I had believed to be tabs were not valid tabs in linux. Not sure how they were converted exactly but that was the error. Thank you for making me double check myself @ElliottFrisch – Mason Toy Apr 07 '16 at 19:14
  • Yeah it looks like it, I didn't find that one unfortunately. I can mark it though. @tripleee – Mason Toy Apr 07 '16 at 20:54

1 Answers1

1

For anyone who runs into this problem later on. The issue is likely to be from conversion from some text editor. The tabs that I had made in brackets are not actually counted as tabs. If you are going to be writing a make file you may as well just pull up your linux editor like vi just to be sure that everything is formatted correctly.

Mason Toy
  • 109
  • 9