started smart includes
authorPatrik Gornicz <Gornicz.P@gmail.com>
Sun, 28 Sep 2008 03:19:20 +0000 (23:19 -0400)
committerPatrik Gornicz <Gornicz.P@gmail.com>
Sun, 28 Sep 2008 03:19:20 +0000 (23:19 -0400)
src/Effects/files.mk [new file with mode: 0644]
src/Entities/files.mk [new file with mode: 0644]
src/GameStates/files.mk [new file with mode: 0644]
src/Makefile
src/config/files.mk [new file with mode: 0644]
src/files.mk [new file with mode: 0644]
src/graphics/files.mk [new file with mode: 0644]
src/input/files.mk [new file with mode: 0644]

diff --git a/src/Effects/files.mk b/src/Effects/files.mk
new file mode 100644 (file)
index 0000000..96e7d02
--- /dev/null
@@ -0,0 +1,11 @@
+CURDIR         := Effects/
+FILES  := # insure blank
+
+FILES += Effect.cpp
+FILES += Gravity.cpp
+FILES += GravityWell.cpp
+FILES += Screen.cpp
+
+FILES := $(addprefix,${CURDIR},${FILES})
+
+SRCS += ${FILES}
diff --git a/src/Entities/files.mk b/src/Entities/files.mk
new file mode 100644 (file)
index 0000000..3d008fa
--- /dev/null
@@ -0,0 +1,15 @@
+CURDIR         := Entities/
+FILES  := # insure blank
+
+FILES += Ball.cpp
+FILES += Entity.cpp
+FILES += Line.cpp
+FILES += Particle.cpp
+FILES += PhysicsEntity.cpp
+FILES += Point.cpp
+FILES += Polygon.cpp
+FILES += WindParticle.cpp
+
+FILES := $(addprefix,${CURDIR},${FILES})
+
+SRCS += ${FILES}
diff --git a/src/GameStates/files.mk b/src/GameStates/files.mk
new file mode 100644 (file)
index 0000000..b0b28e1
--- /dev/null
@@ -0,0 +1,11 @@
+CURDIR         := GameStates/
+FILES  := # insure blank
+
+FILES += CreatingPolygon.cpp
+FILES += GameState.cpp
+FILES += Paused.cpp
+FILES += Running.cpp
+
+FILES := $(addprefix,${CURDIR},${FILES})
+
+SRCS += ${FILES}
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
diff --git a/src/config/files.mk b/src/config/files.mk
new file mode 100644 (file)
index 0000000..bd06d8c
--- /dev/null
@@ -0,0 +1,10 @@
+CURDIR         := config/
+FILES  := # insure blank
+
+FILES += config.cpp
+FILES += reader.cpp
+FILES += keys.cpp
+
+FILES := $(addprefix,${CURDIR},${FILES})
+
+SRCS += ${FILES}
diff --git a/src/files.mk b/src/files.mk
new file mode 100644 (file)
index 0000000..bf09925
--- /dev/null
@@ -0,0 +1,19 @@
+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}
diff --git a/src/graphics/files.mk b/src/graphics/files.mk
new file mode 100644 (file)
index 0000000..d730552
--- /dev/null
@@ -0,0 +1,8 @@
+CURDIR         := graphics/
+FILES  := # insure blank
+
+FILES += graphics.cpp
+
+FILES := $(addprefix,${CURDIR},${FILES})
+
+SRCS += ${FILES}
diff --git a/src/input/files.mk b/src/input/files.mk
new file mode 100644 (file)
index 0000000..3ca4ad0
--- /dev/null
@@ -0,0 +1,8 @@
+CURDIR         := input/
+FILES  := # insure blank
+
+FILES += inputManager.cpp
+
+FILES := $(addprefix,${CURDIR},${FILES})
+
+SRCS += ${FILES}