started smart includes
[physics.git] / src / Makefile
index a391724..95fdbfc 100644 (file)
@@ -13,45 +13,17 @@ VALFLAGS := --leak-check=full
 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}
@@ -86,6 +58,8 @@ endif
 
 .PHONY: all
 all: ${TARGET}
+       echo "${SRCS}"
+       echo "${FILES}"
 
 ${TARGET}: ${OBJS}
        ${Q1}echo "${CXX}: $@"
@@ -94,7 +68,7 @@ ${TARGET}: ${OBJS}
 # 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