Reputation: 11
I'm getting this error:
make:7: *** missing separator. Stop.
Line7:
$(CXX) -o $(TARGET) $(OBJS) $(LIBS)
Here is the code:
CXXFLAGS = -O2 -g -Wall -fmessage-length=0
OBJS = main.c
LIBS =
TARGET = main.exe
$(TARGET): $(OBJS)
$(CXX) -o $(TARGET) $(OBJS) $(LIBS)
all: $(TARGET)
clean:
rm -f $(OBJS) $(TARGET)
Upvotes: 1
Views: 1462
Reputation: 17258
The target actions must have an initial TAB
character - not spaces.
$(TARGET): $(OBJS)
$(CXX) -o $(TARGET) $(OBJS) $(LIBS)
^^^^
TAB
clean:
rm -f $(OBJS) $(TARGET)
^^^^
TAB
Upvotes: 1