SRCSDIR := src/
SRCS := # := start
+OBJSDIR := objsd/
+OBJS := # := start
+
+DEPSDIR := deps/
+DEPS := # := start
+
# include all of the dir.mk
include $(addprefix ${SRCSDIR},$(addsuffix dir.mk,${DIRS}))
WORKINGDIR := bind/
-OBJSDIR := objsd/
-OBJS := ${SRCS:.cpp=.o}
-OBJS := $(addprefix ${OBJSDIR},${OBJS})
-
-DEPSDIR := deps/
-DEPS := ${SRCS:.cpp=.d}
-DEPS := $(addprefix ${DEPSDIR},${DEPS})
-
CFGDIRNAME := configs/
SRCCFGDIR := ${CFGDIRNAME}
DSTCFGDIR := ${WORKINGDIR}${CFGDIRNAME}
-CURDIR := Effects/
-FILES := # insure blank
+NEWSRCS := # insure blank
-FILES += Effect.cpp
-FILES += Gravity.cpp
-FILES += GravityWell.cpp
-FILES += Screen.cpp
+NEWSRCS += Effect.cpp
+NEWSRCS += Gravity.cpp
+NEWSRCS += GravityWell.cpp
+NEWSRCS += Screen.cpp
-FILES := $(addprefix ${CURDIR},${FILES})
-SRCS += ${FILES}
+# Post dir setup
+
+CURDIR := Effects/
+
+NEWSRCS := $(addprefix ${CURDIR},${NEWSRCS})
+NEWOBJS := ${NEWSRCS:.cpp=.o}
+NEWDEPS := ${NEWSRCS:.cpp=.d}
+
+# Append to lists
+
+SRCS += ${NEWSRCS}
+OBJS += $(addprefix ${OBJSDIR},${NEWOBJS})
+DEPS += $(addprefix ${DEPSDIR},${NEWDEPS})
+NEWSRCS := # insure blank
+
+NEWSRCS += Ball.cpp
+NEWSRCS += Entity.cpp
+NEWSRCS += Line.cpp
+NEWSRCS += Particle.cpp
+NEWSRCS += PhysicsEntity.cpp
+NEWSRCS += Point.cpp
+NEWSRCS += Polygon.cpp
+NEWSRCS += WindParticle.cpp
+
+
+# Post dir setup
+
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
+NEWSRCS := $(addprefix ${CURDIR},${NEWSRCS})
+NEWOBJS := ${NEWSRCS:.cpp=.o}
+NEWDEPS := ${NEWSRCS:.cpp=.d}
-FILES := $(addprefix ${CURDIR},${FILES})
+# Append to lists
-SRCS += ${FILES}
+SRCS += ${NEWSRCS}
+OBJS += $(addprefix ${OBJSDIR},${NEWOBJS})
+DEPS += $(addprefix ${DEPSDIR},${NEWDEPS})
+NEWSRCS := # insure blank
+
+NEWSRCS += CreatingPolygon.cpp
+NEWSRCS += GameState.cpp
+NEWSRCS += Paused.cpp
+NEWSRCS += Running.cpp
+
+
+# Post dir setup
+
CURDIR := GameStates/
-FILES := # insure blank
-FILES += CreatingPolygon.cpp
-FILES += GameState.cpp
-FILES += Paused.cpp
-FILES += Running.cpp
+NEWSRCS := $(addprefix ${CURDIR},${NEWSRCS})
+NEWOBJS := ${NEWSRCS:.cpp=.o}
+NEWDEPS := ${NEWSRCS:.cpp=.d}
-FILES := $(addprefix ${CURDIR},${FILES})
+# Append to lists
-SRCS += ${FILES}
+SRCS += ${NEWSRCS}
+OBJS += $(addprefix ${OBJSDIR},${NEWOBJS})
+DEPS += $(addprefix ${DEPSDIR},${NEWDEPS})
+NEWSRCS := # insure blank
+
+NEWSRCS += config.cpp
+NEWSRCS += reader.cpp
+NEWSRCS += keys.cpp
+
+
+# Post dir setup
+
CURDIR := config/
-FILES := # insure blank
-FILES += config.cpp
-FILES += reader.cpp
-FILES += keys.cpp
+NEWSRCS := $(addprefix ${CURDIR},${NEWSRCS})
+NEWOBJS := ${NEWSRCS:.cpp=.o}
+NEWDEPS := ${NEWSRCS:.cpp=.d}
-FILES := $(addprefix ${CURDIR},${FILES})
+# Append to lists
-SRCS += ${FILES}
+SRCS += ${NEWSRCS}
+OBJS += $(addprefix ${OBJSDIR},${NEWOBJS})
+DEPS += $(addprefix ${DEPSDIR},${NEWDEPS})
-CURDIR :=
-FILES := # insure blank
+NEWSRCS := # insure blank
-FILES += game.cpp
-FILES += main.cpp
-FILES += mathw.cpp
-FILES += ticks.cpp
-FILES += Vector2.cpp
-FILES += handleSignal.cpp
+NEWSRCS += game.cpp
+NEWSRCS += main.cpp
+NEWSRCS += mathw.cpp
+NEWSRCS += ticks.cpp
+NEWSRCS += Vector2.cpp
+NEWSRCS += handleSignal.cpp
-FILES += entityCreator.cpp
-FILES += entityManager.cpp
-FILES += effectManager.cpp
-FILES += collisionManager.cpp
-FILES += CollisionInfo.cpp
+NEWSRCS += entityCreator.cpp
+NEWSRCS += entityManager.cpp
+NEWSRCS += effectManager.cpp
+NEWSRCS += collisionManager.cpp
+NEWSRCS += CollisionInfo.cpp
-FILES += debug.cpp
+NEWSRCS += debug.cpp
-FILES := $(addprefix ${CURDIR},${FILES})
-SRCS += ${FILES}
+# Post dir setup
+
+CURDIR :=
+
+NEWSRCS := $(addprefix ${CURDIR},${NEWSRCS})
+NEWOBJS := ${NEWSRCS:.cpp=.o}
+NEWDEPS := ${NEWSRCS:.cpp=.d}
+
+# Append to lists
+
+SRCS += ${NEWSRCS}
+OBJS += $(addprefix ${OBJSDIR},${NEWOBJS})
+DEPS += $(addprefix ${DEPSDIR},${NEWDEPS})
+NEWSRCS := # insure blank
+
+NEWSRCS += graphics.cpp
+
+
+# Post dir setup
+
CURDIR := graphics/
-FILES := # insure blank
-FILES += graphics.cpp
+NEWSRCS := $(addprefix ${CURDIR},${NEWSRCS})
+NEWOBJS := ${NEWSRCS:.cpp=.o}
+NEWDEPS := ${NEWSRCS:.cpp=.d}
-FILES := $(addprefix ${CURDIR},${FILES})
+# Append to lists
-SRCS += ${FILES}
+SRCS += ${NEWSRCS}
+OBJS += $(addprefix ${OBJSDIR},${NEWOBJS})
+DEPS += $(addprefix ${DEPSDIR},${NEWDEPS})
+NEWSRCS := # insure blank
+
+NEWSRCS += inputManager.cpp
+
+
+# Post dir setup
+
CURDIR := input/
-FILES := # insure blank
-FILES += inputManager.cpp
+NEWSRCS := $(addprefix ${CURDIR},${NEWSRCS})
+NEWOBJS := ${NEWSRCS:.cpp=.o}
+NEWDEPS := ${NEWSRCS:.cpp=.d}
-FILES := $(addprefix ${CURDIR},${FILES})
+# Append to lists
-SRCS += ${FILES}
+SRCS += ${NEWSRCS}
+OBJS += $(addprefix ${OBJSDIR},${NEWOBJS})
+DEPS += $(addprefix ${DEPSDIR},${NEWDEPS})
+NEWSRCS := # insure blank
+
+NEWSRCS += Autolock.cpp
+NEWSRCS += Mutex.cpp
+
+
+# Post dir setup
+
CURDIR := locks/
-FILES := # insure blank
-FILES += Autolock.cpp
-FILES += Mutex.cpp
+NEWSRCS := $(addprefix ${CURDIR},${NEWSRCS})
+NEWOBJS := ${NEWSRCS:.cpp=.o}
+NEWDEPS := ${NEWSRCS:.cpp=.d}
-FILES := $(addprefix ${CURDIR},${FILES})
+# Append to lists
-SRCS += ${FILES}
+SRCS += ${NEWSRCS}
+OBJS += $(addprefix ${OBJSDIR},${NEWOBJS})
+DEPS += $(addprefix ${DEPSDIR},${NEWDEPS})