0

So when I run my makefile I get the error in the title (Fatal error in reader: makefile, unexpected end of line seen Line 8) and I don't honestly know what's going wrong.

CC=g++
CFLAGS= -g -c -Wall `sdl-configs --cflags`
LDFLAGS = `sdl-config --libs`
SOURCES= dpcm.cpp
OBJECTS=$(SOURCES:.cpp=.o)
EXECUTABLE=dpcm

all: $(SOURCES) $(EXECUTABLE)

$(EXECUTABLE): $(OBJECTS)
    $(CC) $(OBJECTS) -o $@ $(LDFLAGS)

.cpp.o:
    $(CC) $(CFLAGS) $< -o $@

clean:
    rm *.o
    rm $(EXECUTABLE)

I took this code from a lab I'd worked on and altered the variable names to pertain to my program, so I'm not sure why it's not compiling.

  • That is not a message printed by the most commonly used version of make (GNU make). So, please provide information about what operating system and version of OS you're using, what make command you are invoking, and what type and version of the command you're using. Usually when asking questions it's best to include not just your exact file but also cut and paste the command you invoked and the error output you received. – MadScientist May 25 '16 at 21:47
  • 1
    Please check that all line endings are matching to the platform where you are trying to build. That could be a reason especially after you copied a file from another system and edited it. – Mikhail Volskiy May 25 '16 at 21:49
  • Are those single quotes or backticks? Either way, I don't see why you need them, so try omitting them. And if that doesn't work, write an extremely simple makefile that *does* work (even if it does nothing), and then try modifying the two makefiles to get them more and more similar until you find the change that causes the error. – Beta May 26 '16 at 00:11

0 Answers0