From 0376f786586cb8183437837007be8df7f054fb80 Mon Sep 17 00:00:00 2001 From: Patrik Gornicz Date: Sat, 27 Sep 2008 23:19:20 -0400 Subject: [PATCH] started smart includes --- src/Effects/files.mk | 11 ++++++++++ src/Entities/files.mk | 15 ++++++++++++++ src/GameStates/files.mk | 11 ++++++++++ src/Makefile | 54 +++++++++++++------------------------------------ src/config/files.mk | 10 +++++++++ src/files.mk | 19 +++++++++++++++++ src/graphics/files.mk | 8 ++++++++ src/input/files.mk | 8 ++++++++ 8 files changed, 96 insertions(+), 40 deletions(-) create mode 100644 src/Effects/files.mk create mode 100644 src/Entities/files.mk create mode 100644 src/GameStates/files.mk create mode 100644 src/config/files.mk create mode 100644 src/files.mk create mode 100644 src/graphics/files.mk create mode 100644 src/input/files.mk diff --git a/src/Effects/files.mk b/src/Effects/files.mk new file mode 100644 index 0000000..96e7d02 --- /dev/null +++ b/src/Effects/files.mk @@ -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 index 0000000..3d008fa --- /dev/null +++ b/src/Entities/files.mk @@ -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 index 0000000..b0b28e1 --- /dev/null +++ b/src/GameStates/files.mk @@ -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} diff --git a/src/Makefile b/src/Makefile index a391724..95fdbfc 100644 --- a/src/Makefile +++ b/src/Makefile @@ -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 index 0000000..bd06d8c --- /dev/null +++ b/src/config/files.mk @@ -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 index 0000000..bf09925 --- /dev/null +++ b/src/files.mk @@ -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 index 0000000..d730552 --- /dev/null +++ b/src/graphics/files.mk @@ -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 index 0000000..3ca4ad0 --- /dev/null +++ b/src/input/files.mk @@ -0,0 +1,8 @@ +CURDIR := input/ +FILES := # insure blank + +FILES += inputManager.cpp + +FILES := $(addprefix,${CURDIR},${FILES}) + +SRCS += ${FILES} -- 2.10.2