I'm a bit new to makefiles, so pardon me if this question is really foolish.
If I have a single class called Entity, my makefile will be as follows:
Code:
CCC = mingw32-g++
BINARIES = Main.o Container.o Entity.o Object.o Room.o
all : $(BINARIES)
${CCC} -o game.exe ${BINARIES}
Main.o : Entity.h
$(CCC) -c Main.cpp
Entity.o : Entity.h Entity.cpp
$(CCC) -c Entity.cpp
clean :
del /q /s ${BINARIES}
I'm concerned about the
Code:
Entity.o : Entity.h Entity.cpp
line. If I later make a class called TempEntity, which is a derived class of Entity, how would I need to compile the O file?
Would it be:
Code:
TempEntity.o : TempEntity.h TempEntity.cpp
or
Code:
TempEntity.o : Entity.h Entity.cpp TempEntity.h TempEntity.cpp
and why?
--Ashiq