From 16f1445959244e40f1d68afb175a87c613e4b6f0 Mon Sep 17 00:00:00 2001 From: Patrik Gornicz Date: Sun, 18 Jan 2009 20:24:12 -0500 Subject: [PATCH] giving more control to dir.mk files --- Makefile | 14 ++++++-------- src/Effects/dir.mk | 26 ++++++++++++++++++-------- src/Entities/dir.mk | 32 +++++++++++++++++++++----------- src/GameStates/dir.mk | 24 +++++++++++++++++------- src/config/dir.mk | 22 ++++++++++++++++------ src/dir.mk | 42 ++++++++++++++++++++++++++---------------- src/graphics/dir.mk | 18 ++++++++++++++---- src/input/dir.mk | 18 ++++++++++++++---- src/locks/dir.mk | 20 +++++++++++++++----- 9 files changed, 147 insertions(+), 69 deletions(-) diff --git a/Makefile b/Makefile index 85ac199..e50347d 100644 --- a/Makefile +++ b/Makefile @@ -26,19 +26,17 @@ DIRS += locks/ 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} diff --git a/src/Effects/dir.mk b/src/Effects/dir.mk index 96e19de..fef094b 100644 --- a/src/Effects/dir.mk +++ b/src/Effects/dir.mk @@ -1,11 +1,21 @@ -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}) diff --git a/src/Entities/dir.mk b/src/Entities/dir.mk index e1e39d1..d51df6e 100644 --- a/src/Entities/dir.mk +++ b/src/Entities/dir.mk @@ -1,15 +1,25 @@ +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}) diff --git a/src/GameStates/dir.mk b/src/GameStates/dir.mk index 3a1e916..5665c36 100644 --- a/src/GameStates/dir.mk +++ b/src/GameStates/dir.mk @@ -1,11 +1,21 @@ +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}) diff --git a/src/config/dir.mk b/src/config/dir.mk index 6480308..b0252ab 100644 --- a/src/config/dir.mk +++ b/src/config/dir.mk @@ -1,10 +1,20 @@ +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}) diff --git a/src/dir.mk b/src/dir.mk index 6bd3855..886c693 100644 --- a/src/dir.mk +++ b/src/dir.mk @@ -1,21 +1,31 @@ -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}) diff --git a/src/graphics/dir.mk b/src/graphics/dir.mk index 3a9c271..7028eef 100644 --- a/src/graphics/dir.mk +++ b/src/graphics/dir.mk @@ -1,8 +1,18 @@ +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}) diff --git a/src/input/dir.mk b/src/input/dir.mk index abd97a1..a039bae 100644 --- a/src/input/dir.mk +++ b/src/input/dir.mk @@ -1,8 +1,18 @@ +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}) diff --git a/src/locks/dir.mk b/src/locks/dir.mk index bce9bfe..f7e8b9e 100644 --- a/src/locks/dir.mk +++ b/src/locks/dir.mk @@ -1,9 +1,19 @@ +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}) -- 2.10.2