TARGET := ../run_physics
SRCS := # simply to keep every line below the same
-SRCS += game.cpp
-SRCS += main.cpp
-SRCS += mathw.cpp
-SRCS += ticks.cpp
-SRCS += Vector2.cpp
-SRCS += handleSignal.cpp
-
-SRCS += entityCreator.cpp
-SRCS += entityManager.cpp
-SRCS += effectManager.cpp
-SRCS += collisionManager.cpp
-SRCS += CollisionInfo.cpp
-
-SRCS += Entities/Ball.cpp
-SRCS += Entities/Entity.cpp
-SRCS += Entities/Line.cpp
-SRCS += Entities/Particle.cpp
-SRCS += Entities/PhysicsEntity.cpp
-SRCS += Entities/Point.cpp
-SRCS += Entities/Polygon.cpp
-SRCS += Entities/WindParticle.cpp
-
-SRCS += GameStates/CreatingPolygon.cpp
-SRCS += GameStates/GameState.cpp
-SRCS += GameStates/Paused.cpp
-SRCS += GameStates/Running.cpp
-
-SRCS += Effects/Effect.cpp
-SRCS += Effects/Gravity.cpp
-SRCS += Effects/GravityWell.cpp
-SRCS += Effects/Screen.cpp
-
-SRCS += config/config.cpp
-SRCS += config/reader.cpp
-SRCS += config/keys.cpp
-
-SRCS += input/inputManager.cpp
-
-SRCS += graphics/graphics.cpp
+
+DIRS := # := start
+DIRS += .
+DIRS += Entities
+DIRS += GameStates
+DIRS += Effects
+DIRS += config
+DIRS += input
+DIRS += graphics
+
+include $(addsuffix /files.mk,${DIRS})
OBJSDIR := ../objs/
OBJS := ${SRCS:.cpp=.o}
.PHONY: all
all: ${TARGET}
+ echo "${SRCS}"
+ echo "${FILES}"
${TARGET}: ${OBJS}
${Q1}echo "${CXX}: $@"
# rule to make a depend file from a .cpp
${DEPSDIR}%.d: %.cpp
${Q1}echo "DEP: $@"
- ${Q2}${CXX} -M ${CXXFLAGS} $< | sed 's,: , $@: ,' > $@
+ ${Q2}${CXX} -MM ${CXXFLAGS} $< | sed 's,: , $@: ,' > $@
# rule to make an object file from a .cpp
${OBJSDIR}%.o: %.cpp
--- /dev/null
+CURDIR := ./
+FILES := # insure blank
+
+FILES += game.cpp
+FILES += main.cpp
+FILES += mathw.cpp
+FILES += ticks.cpp
+FILES += Vector2.cpp
+FILES += handleSignal.cpp
+
+FILES += entityCreator.cpp
+FILES += entityManager.cpp
+FILES += effectManager.cpp
+FILES += collisionManager.cpp
+FILES += CollisionInfo.cpp
+
+FILES := $(addprefix,${CURDIR},${FILES})
+
+SRCS += ${FILES}