Hello!
I'm trying to learn c++ from the ground up so I'm figuring out makefiles.
I have
Code:
CPP = g++
OFLAG = -o
.SUFFIXES : .o .cpp
.cpp.o :
$(CPP) -c $<
stw: main.o PieceClothing.o
$(CPP) $(OFLAG) main main.o PieceClothing.o
PieceClothing.o: PieceClothing.cpp PieceClothing.h
main.o: main.cpp PieceClothing.h
And when I type make I get
Code:
make: *** No rule to make target `main.cpp', needed by `main.o'. Stop.
What am I doing wrong?
Shouldn't the suffix rule take care of a target for main.cpp?