From 6d8ae4070f65c0c2571556cbc8742bdda8011f43 Mon Sep 17 00:00:00 2001 From: Patrik Gornicz Date: Mon, 22 Jun 2009 23:11:50 -0400 Subject: [PATCH] make system changed to be a subset of the library make system currently the objs are compiling --- dir.mk | 34 +++++++++++++++++++++++ lists.mk | 8 ++++++ makefinal | 3 --- makewin32 | 3 --- rules.mk | 72 +++++++++++++++++++++++++++++++++++++++++++++++++ src/Effects/dir.mk | 47 ++++++++++++++++++++++---------- src/Effects/files.mk | 29 ++++++++++++++++++++ src/Entities/dir.mk | 51 ++++++++++++++++++++++------------- src/Entities/files.mk | 33 +++++++++++++++++++++++ src/GameStates/dir.mk | 47 ++++++++++++++++++++++---------- src/GameStates/files.mk | 29 ++++++++++++++++++++ src/config/dir.mk | 46 ++++++++++++++++++++++--------- src/config/files.mk | 28 +++++++++++++++++++ src/dir.mk | 55 +++++++++++++++++++------------------ src/files.mk | 41 ++++++++++++++++++++++++++++ src/graphics/dir.mk | 44 ++++++++++++++++++++++-------- src/graphics/files.mk | 26 ++++++++++++++++++ src/input/dir.mk | 44 ++++++++++++++++++++++-------- src/input/files.mk | 26 ++++++++++++++++++ tvars.mk | 11 ++++++++ vars.mk | 62 ++++++++++++++++++++++++++++++++++++++++++ 21 files changed, 624 insertions(+), 115 deletions(-) create mode 100644 dir.mk create mode 100644 lists.mk delete mode 100755 makefinal delete mode 100755 makewin32 create mode 100644 rules.mk 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 create mode 100644 tvars.mk create mode 100644 vars.mk diff --git a/dir.mk b/dir.mk new file mode 100644 index 0000000..e69f03c --- /dev/null +++ b/dir.mk @@ -0,0 +1,34 @@ + +T_DIRNAME := physics + +################################################################################ + +# top define +DIRNAME := ${T_DIRNAME} +D := ${DIRNAME} +P := ${DIRNAME} +CURDIR := ${DIRNAME}/ + +T_DIRNAME := + +include ${CURDIR}${G_VARSMK} + +include ${CURDIR}${G_LISTSMK} + +include ${SRCSDIR_$P}${G_DIRMK} + +include ${CURDIR}${G_TVARSMK} + +include ${CURDIR}${G_RULESMK} + +${L_BLDDIRS_$P}: | $${@D} + +L_BLDDIRS_$P += ${OBJSDIR_$P} +L_BLDDIRS_$P += ${DEPSDIR_$P} +L_BLDDIRS_$P += ${BINDIR_$P} +L_BLDDIRS_$P += ${DSTCFGDIR_$P} +L_BLDDIRS_$P += ${DSTLIBSDIR_$P} + +L_DEPS += ${L_DEPS_$P} +L_BLDDIRS += ${L_BLDDIRS_$P} + diff --git a/lists.mk b/lists.mk new file mode 100644 index 0000000..ca9af6b --- /dev/null +++ b/lists.mk @@ -0,0 +1,8 @@ + +# lists populated by dir.mk files in subdirectories +L_SRCS_$P := # := start +L_OBJS_$P := # := start +L_DEPS_$P := # := start + +L_BLDDIRS_$P := # := start + diff --git a/makefinal b/makefinal deleted file mode 100755 index 1c8877a..0000000 --- a/makefinal +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -exec make BUILD=FINAL $@ diff --git a/makewin32 b/makewin32 deleted file mode 100755 index fa89ce4..0000000 --- a/makewin32 +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -exec make BUILD=WIN32 $@ diff --git a/rules.mk b/rules.mk new file mode 100644 index 0000000..ac7ed7d --- /dev/null +++ b/rules.mk @@ -0,0 +1,72 @@ + +# HACK +all: ${TARGET_$P} ${CFGS_$P} ${LIBSTXT_$P} ${LIBSCPY_$P} ${TXT_$P} + +#${G_OBJS_TESTS}: ${L_OBJS_$P} +#${G_DEPS_TESTS}: ${L_DEPS_$P} + + +# how to link the main target +${TARGETTMP_$P}: ${L_OBJS_$P} | $${@D} + ${cmd-link} + +# rule to copy tmp target to working directory +${TARGET_$P}: ${TARGETTMP_$P} | $${@D} + ${cmd-cp} + +# how to copy a library to the bin directory +#${BINDIR_$P}${SONAME_${G_LIB}}: ${TARGET_${G_LIB}} | $${@D} +# ${cmd-cp} + +# rule to copy the config files into the working directory +${DSTCFGDIR_$P}%: ${SRCCFGDIR_$P}% | $$(dir $$@) + ${cmd-cp} + +# rule to copy the library files into the working directory +${DSTLIBSDIR_$P}%: ${SRCLIBSDIR_$P}% | $$(dir $$@) + ${cmd-cp} + +# rule to copy the text files into the working directory +${DSTTXTDIR_$P}%: ${SRCTXTDIR_$P}% | $$(dir $$@) + ${cmd-cp} + +# rule to make an object file from a .cpp +${OBJSDIR_$P}%.o: ${SRCSDIR_$P}%.cpp | $${@D} + ${cmd-cpptoobj} + +# rule to make a depend file from a .cpp +${DEPSDIR_$P}%.d: ${SRCSDIR_$P}%.cpp | $${@D} + ${cmd-cpptodep} + + +L_CLEANCMDS += cleanbin-$P +cleanbin: cleanbin-$P +.PHONY: cleanbin-$P +cleanbin-$P: + ${Q1}${PRNTFMT} "rm" "${BINDIR}" + ${Q2}rm -rf ${BINDIR} + +L_CLEANCMDS += cleanobjs-$P +cleanobjs: cleanobjs-$P +.PHONY: cleanobjs-$P +cleanobjs-$P: + ${Q1}${PRNTFMT} "rm" "${OBJSDIR}" + ${Q2}rm -rf ${OBJSDIR} + +L_CLEANCMDS += cleandeps-$P +cleandeps: cleandeps-$P +.PHONY: cleandeps-$P +cleandeps-$P: + ${Q1}${PRNTFMT} "rm" "${DEPSDIR}" + ${Q2}rm -rf ${DEPSDIR} + +L_CLEANCMDS += clean-$P +clean: clean-$P +.PHONY: clean-$P +clean-$P: cleanobjs-$P cleanbin-$P + +L_CLEANCMDS += cleanall-$P +cleanall: cleanall-$P +.PHONY: cleanall-$P +cleanall-$P: cleanbin-$P cleanobjs-$P cleandeps-$P + diff --git a/src/Effects/dir.mk b/src/Effects/dir.mk index fef094b..40220ab 100644 --- a/src/Effects/dir.mk +++ b/src/Effects/dir.mk @@ -1,21 +1,40 @@ -NEWSRCS := # insure blank -NEWSRCS += Effect.cpp -NEWSRCS += Gravity.cpp -NEWSRCS += GravityWell.cpp -NEWSRCS += Screen.cpp +T_DIRNAME := Effects +################################################################################ -# Post dir setup +# save +T := $D_TEMP + DIRNAME_$T := ${DIRNAME} + D_$T := $D -CURDIR := Effects/ + DIRNAME := ${T_DIRNAME} + D := $D_${DIRNAME} -NEWSRCS := $(addprefix ${CURDIR},${NEWSRCS}) -NEWOBJS := ${NEWSRCS:.cpp=.o} -NEWDEPS := ${NEWSRCS:.cpp=.d} + DIRNAME_$D := ${DIRNAME_$T} + D_$D := ${D_$T} -# Append to lists + DIRNAME_$T := + D_$T := +T := + +T_DIRNAME := + +CURDIR_$D := ${CURDIR} +CURDIR := ${CURDIR_$D}${DIRNAME}/ + +SRCPATH_$D := ${SRCPATH} +SRCPATH := ${SRCPATH_$D}${DIRNAME}/ + + +include ${CURDIR}${G_FILESMK} +include $(addprefix ${SRCSDIR_$P},$(addsuffix ${G_DIRMK},${NEWDIRS})) + + +# restore + +CURDIR := ${CURDIR_$D} +SRCPATH := ${SRCPATH_$D} +DIRNAME := ${DIRNAME_$D} +D := ${D_$D} -SRCS += ${NEWSRCS} -OBJS += $(addprefix ${OBJSDIR},${NEWOBJS}) -DEPS += $(addprefix ${DEPSDIR},${NEWDEPS}) diff --git a/src/Effects/files.mk b/src/Effects/files.mk new file mode 100644 index 0000000..74dd006 --- /dev/null +++ b/src/Effects/files.mk @@ -0,0 +1,29 @@ + +NEWSRCS := # := start; empty + +NEWSRCS += Effect.cpp +NEWSRCS += Gravity.cpp +NEWSRCS += GravityWell.cpp +NEWSRCS += Screen.cpp + +NEWDIRS := # := start; empty + +################################################################################ + +NEWSRCS := $(addprefix ${SRCPATH},${NEWSRCS}) +NEWDIRS := $(addprefix ${SRCPATH},${NEWDIRS}) +NEWOBJS := ${NEWSRCS:.cpp=.o} +NEWDEPS := ${NEWSRCS:.cpp=.d} + +NEWOBJSDIRS := $(addprefix ${OBJSDIR_$P},${NEWDIRS}) +NEWDEPSDIRS := $(addprefix ${DEPSDIR_$P},${NEWDIRS}) + +# Append to lists + +L_SRCS_$P += ${NEWSRCS} +L_OBJS_$P += $(addprefix ${OBJSDIR_$P},${NEWOBJS}) +L_DEPS_$P += $(addprefix ${DEPSDIR_$P},${NEWDEPS}) + +L_BLDDIRS_$P += ${NEWOBJSDIRS} +L_BLDDIRS_$P += ${NEWDEPSDIRS} + diff --git a/src/Entities/dir.mk b/src/Entities/dir.mk index d51df6e..ab215b1 100644 --- a/src/Entities/dir.mk +++ b/src/Entities/dir.mk @@ -1,25 +1,40 @@ -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 +T_DIRNAME := Entities +################################################################################ -# Post dir setup +# save +T := $D_TEMP + DIRNAME_$T := ${DIRNAME} + D_$T := $D -CURDIR := Entities/ + DIRNAME := ${T_DIRNAME} + D := $D_${DIRNAME} -NEWSRCS := $(addprefix ${CURDIR},${NEWSRCS}) -NEWOBJS := ${NEWSRCS:.cpp=.o} -NEWDEPS := ${NEWSRCS:.cpp=.d} + DIRNAME_$D := ${DIRNAME_$T} + D_$D := ${D_$T} -# Append to lists + DIRNAME_$T := + D_$T := +T := + +T_DIRNAME := + +CURDIR_$D := ${CURDIR} +CURDIR := ${CURDIR_$D}${DIRNAME}/ + +SRCPATH_$D := ${SRCPATH} +SRCPATH := ${SRCPATH_$D}${DIRNAME}/ + + +include ${CURDIR}${G_FILESMK} +include $(addprefix ${SRCSDIR_$P},$(addsuffix ${G_DIRMK},${NEWDIRS})) + + +# restore + +CURDIR := ${CURDIR_$D} +SRCPATH := ${SRCPATH_$D} +DIRNAME := ${DIRNAME_$D} +D := ${D_$D} -SRCS += ${NEWSRCS} -OBJS += $(addprefix ${OBJSDIR},${NEWOBJS}) -DEPS += $(addprefix ${DEPSDIR},${NEWDEPS}) diff --git a/src/Entities/files.mk b/src/Entities/files.mk new file mode 100644 index 0000000..805444e --- /dev/null +++ b/src/Entities/files.mk @@ -0,0 +1,33 @@ + +NEWSRCS := # := start; empty + +NEWSRCS += Ball.cpp +NEWSRCS += Entity.cpp +NEWSRCS += Line.cpp +NEWSRCS += Particle.cpp +NEWSRCS += PhysicsEntity.cpp +NEWSRCS += Point.cpp +NEWSRCS += Polygon.cpp +NEWSRCS += WindParticle.cpp + +NEWDIRS := # := start; empty + +################################################################################ + +NEWSRCS := $(addprefix ${SRCPATH},${NEWSRCS}) +NEWDIRS := $(addprefix ${SRCPATH},${NEWDIRS}) +NEWOBJS := ${NEWSRCS:.cpp=.o} +NEWDEPS := ${NEWSRCS:.cpp=.d} + +NEWOBJSDIRS := $(addprefix ${OBJSDIR_$P},${NEWDIRS}) +NEWDEPSDIRS := $(addprefix ${DEPSDIR_$P},${NEWDIRS}) + +# Append to lists + +L_SRCS_$P += ${NEWSRCS} +L_OBJS_$P += $(addprefix ${OBJSDIR_$P},${NEWOBJS}) +L_DEPS_$P += $(addprefix ${DEPSDIR_$P},${NEWDEPS}) + +L_BLDDIRS_$P += ${NEWOBJSDIRS} +L_BLDDIRS_$P += ${NEWDEPSDIRS} + diff --git a/src/GameStates/dir.mk b/src/GameStates/dir.mk index 5665c36..3712850 100644 --- a/src/GameStates/dir.mk +++ b/src/GameStates/dir.mk @@ -1,21 +1,40 @@ -NEWSRCS := # insure blank -NEWSRCS += CreatingPolygon.cpp -NEWSRCS += GameState.cpp -NEWSRCS += Paused.cpp -NEWSRCS += Running.cpp +T_DIRNAME := GameStates +################################################################################ -# Post dir setup +# save +T := $D_TEMP + DIRNAME_$T := ${DIRNAME} + D_$T := $D -CURDIR := GameStates/ + DIRNAME := ${T_DIRNAME} + D := $D_${DIRNAME} -NEWSRCS := $(addprefix ${CURDIR},${NEWSRCS}) -NEWOBJS := ${NEWSRCS:.cpp=.o} -NEWDEPS := ${NEWSRCS:.cpp=.d} + DIRNAME_$D := ${DIRNAME_$T} + D_$D := ${D_$T} -# Append to lists + DIRNAME_$T := + D_$T := +T := + +T_DIRNAME := + +CURDIR_$D := ${CURDIR} +CURDIR := ${CURDIR_$D}${DIRNAME}/ + +SRCPATH_$D := ${SRCPATH} +SRCPATH := ${SRCPATH_$D}${DIRNAME}/ + + +include ${CURDIR}${G_FILESMK} +include $(addprefix ${SRCSDIR_$P},$(addsuffix ${G_DIRMK},${NEWDIRS})) + + +# restore + +CURDIR := ${CURDIR_$D} +SRCPATH := ${SRCPATH_$D} +DIRNAME := ${DIRNAME_$D} +D := ${D_$D} -SRCS += ${NEWSRCS} -OBJS += $(addprefix ${OBJSDIR},${NEWOBJS}) -DEPS += $(addprefix ${DEPSDIR},${NEWDEPS}) diff --git a/src/GameStates/files.mk b/src/GameStates/files.mk new file mode 100644 index 0000000..5d230b9 --- /dev/null +++ b/src/GameStates/files.mk @@ -0,0 +1,29 @@ + +NEWSRCS := # := start; empty + +NEWSRCS += CreatingPolygon.cpp +NEWSRCS += GameState.cpp +NEWSRCS += Paused.cpp +NEWSRCS += Running.cpp + +NEWDIRS := # := start; empty + +################################################################################ + +NEWSRCS := $(addprefix ${SRCPATH},${NEWSRCS}) +NEWDIRS := $(addprefix ${SRCPATH},${NEWDIRS}) +NEWOBJS := ${NEWSRCS:.cpp=.o} +NEWDEPS := ${NEWSRCS:.cpp=.d} + +NEWOBJSDIRS := $(addprefix ${OBJSDIR_$P},${NEWDIRS}) +NEWDEPSDIRS := $(addprefix ${DEPSDIR_$P},${NEWDIRS}) + +# Append to lists + +L_SRCS_$P += ${NEWSRCS} +L_OBJS_$P += $(addprefix ${OBJSDIR_$P},${NEWOBJS}) +L_DEPS_$P += $(addprefix ${DEPSDIR_$P},${NEWDEPS}) + +L_BLDDIRS_$P += ${NEWOBJSDIRS} +L_BLDDIRS_$P += ${NEWDEPSDIRS} + diff --git a/src/config/dir.mk b/src/config/dir.mk index b0252ab..5d686ed 100644 --- a/src/config/dir.mk +++ b/src/config/dir.mk @@ -1,20 +1,40 @@ -NEWSRCS := # insure blank -NEWSRCS += config.cpp -NEWSRCS += reader.cpp -NEWSRCS += keys.cpp +T_DIRNAME := config +################################################################################ -# Post dir setup +# save +T := $D_TEMP + DIRNAME_$T := ${DIRNAME} + D_$T := $D -CURDIR := config/ + DIRNAME := ${T_DIRNAME} + D := $D_${DIRNAME} -NEWSRCS := $(addprefix ${CURDIR},${NEWSRCS}) -NEWOBJS := ${NEWSRCS:.cpp=.o} -NEWDEPS := ${NEWSRCS:.cpp=.d} + DIRNAME_$D := ${DIRNAME_$T} + D_$D := ${D_$T} -# Append to lists + DIRNAME_$T := + D_$T := +T := + +T_DIRNAME := + +CURDIR_$D := ${CURDIR} +CURDIR := ${CURDIR_$D}${DIRNAME}/ + +SRCPATH_$D := ${SRCPATH} +SRCPATH := ${SRCPATH_$D}${DIRNAME}/ + + +include ${CURDIR}${G_FILESMK} +include $(addprefix ${SRCSDIR_$P},$(addsuffix ${G_DIRMK},${NEWDIRS})) + + +# restore + +CURDIR := ${CURDIR_$D} +SRCPATH := ${SRCPATH_$D} +DIRNAME := ${DIRNAME_$D} +D := ${D_$D} -SRCS += ${NEWSRCS} -OBJS += $(addprefix ${OBJSDIR},${NEWOBJS}) -DEPS += $(addprefix ${DEPSDIR},${NEWDEPS}) diff --git a/src/config/files.mk b/src/config/files.mk new file mode 100644 index 0000000..89dc34f --- /dev/null +++ b/src/config/files.mk @@ -0,0 +1,28 @@ + +NEWSRCS := # := start; empty + +NEWSRCS += config.cpp +NEWSRCS += reader.cpp +NEWSRCS += keys.cpp + +NEWDIRS := # := start; empty + +################################################################################ + +NEWSRCS := $(addprefix ${SRCPATH},${NEWSRCS}) +NEWDIRS := $(addprefix ${SRCPATH},${NEWDIRS}) +NEWOBJS := ${NEWSRCS:.cpp=.o} +NEWDEPS := ${NEWSRCS:.cpp=.d} + +NEWOBJSDIRS := $(addprefix ${OBJSDIR_$P},${NEWDIRS}) +NEWDEPSDIRS := $(addprefix ${DEPSDIR_$P},${NEWDIRS}) + +# Append to lists + +L_SRCS_$P += ${NEWSRCS} +L_OBJS_$P += $(addprefix ${OBJSDIR_$P},${NEWOBJS}) +L_DEPS_$P += $(addprefix ${DEPSDIR_$P},${NEWDEPS}) + +L_BLDDIRS_$P += ${NEWOBJSDIRS} +L_BLDDIRS_$P += ${NEWDEPSDIRS} + diff --git a/src/dir.mk b/src/dir.mk index cd1e410..37c1041 100644 --- a/src/dir.mk +++ b/src/dir.mk @@ -1,41 +1,40 @@ -NEWSRCS := # insure blank -NEWSRCS += game.cpp -NEWSRCS += main.cpp -NEWSRCS += handleSignal.cpp +T_DIRNAME := src -NEWSRCS += entityCreator.cpp -NEWSRCS += entityManager.cpp -NEWSRCS += effectManager.cpp -NEWSRCS += collisionManager.cpp -NEWSRCS += CollisionInfo.cpp +################################################################################ +# save +T := $D_TEMP + DIRNAME_$T := ${DIRNAME} + D_$T := $D -NEWDIRS := # insure blank + DIRNAME := ${T_DIRNAME} + D := $D_${DIRNAME} -NEWDIRS += Entities/ -NEWDIRS += GameStates/ -NEWDIRS += Effects/ -NEWDIRS += config/ -NEWDIRS += input/ -NEWDIRS += graphics/ + DIRNAME_$D := ${DIRNAME_$T} + D_$D := ${D_$T} + DIRNAME_$T := + D_$T := +T := -# Post dir setup +T_DIRNAME := -CURDIR := +CURDIR_$D := ${CURDIR} +CURDIR := ${CURDIR_$D}${DIRNAME}/ -NEWSRCS := $(addprefix ${CURDIR},${NEWSRCS}) -NEWDIRS := $(addprefix ${CURDIR},${NEWDIRS}) -NEWOBJS := ${NEWSRCS:.cpp=.o} -NEWDEPS := ${NEWSRCS:.cpp=.d} +# top define +SRCPATH := -# Append to lists -SRCS += ${NEWSRCS} -DIRS += ${NEWDIRS} -OBJS += $(addprefix ${OBJSDIR},${NEWOBJS}) -DEPS += $(addprefix ${DEPSDIR},${NEWDEPS}) +include ${CURDIR}${G_FILESMK} +include $(addprefix ${SRCSDIR_$P},$(addsuffix ${G_DIRMK},${NEWDIRS})) -include $(addprefix ${SRCSDIR},$(addsuffix ${DIRMK},${NEWDIRS})) +# restore + +CURDIR := ${CURDIR_$D} +SRCPATH := +DIRNAME := ${DIRNAME_$D} +D := ${D_$D} + diff --git a/src/files.mk b/src/files.mk new file mode 100644 index 0000000..5c22328 --- /dev/null +++ b/src/files.mk @@ -0,0 +1,41 @@ + +NEWSRCS := # := start; empty + +NEWSRCS += game.cpp +NEWSRCS += main.cpp +NEWSRCS += handleSignal.cpp + +NEWSRCS += entityCreator.cpp +NEWSRCS += entityManager.cpp +NEWSRCS += effectManager.cpp +NEWSRCS += collisionManager.cpp +NEWSRCS += CollisionInfo.cpp + +NEWDIRS := # := start; empty + +NEWDIRS += Entities/ +NEWDIRS += GameStates/ +NEWDIRS += Effects/ +NEWDIRS += config/ +NEWDIRS += input/ +NEWDIRS += graphics/ + +################################################################################ + +NEWSRCS := $(addprefix ${SRCPATH},${NEWSRCS}) +NEWDIRS := $(addprefix ${SRCPATH},${NEWDIRS}) +NEWOBJS := ${NEWSRCS:.cpp=.o} +NEWDEPS := ${NEWSRCS:.cpp=.d} + +NEWOBJSDIRS := $(addprefix ${OBJSDIR_$P},${NEWDIRS}) +NEWDEPSDIRS := $(addprefix ${DEPSDIR_$P},${NEWDIRS}) + +# Append to lists + +L_SRCS_$P += ${NEWSRCS} +L_OBJS_$P += $(addprefix ${OBJSDIR_$P},${NEWOBJS}) +L_DEPS_$P += $(addprefix ${DEPSDIR_$P},${NEWDEPS}) + +L_BLDDIRS_$P += ${NEWOBJSDIRS} +L_BLDDIRS_$P += ${NEWDEPSDIRS} + diff --git a/src/graphics/dir.mk b/src/graphics/dir.mk index 7028eef..9328018 100644 --- a/src/graphics/dir.mk +++ b/src/graphics/dir.mk @@ -1,18 +1,40 @@ -NEWSRCS := # insure blank -NEWSRCS += graphics.cpp +T_DIRNAME := graphics +################################################################################ -# Post dir setup +# save +T := $D_TEMP + DIRNAME_$T := ${DIRNAME} + D_$T := $D -CURDIR := graphics/ + DIRNAME := ${T_DIRNAME} + D := $D_${DIRNAME} -NEWSRCS := $(addprefix ${CURDIR},${NEWSRCS}) -NEWOBJS := ${NEWSRCS:.cpp=.o} -NEWDEPS := ${NEWSRCS:.cpp=.d} + DIRNAME_$D := ${DIRNAME_$T} + D_$D := ${D_$T} -# Append to lists + DIRNAME_$T := + D_$T := +T := + +T_DIRNAME := + +CURDIR_$D := ${CURDIR} +CURDIR := ${CURDIR_$D}${DIRNAME}/ + +SRCPATH_$D := ${SRCPATH} +SRCPATH := ${SRCPATH_$D}${DIRNAME}/ + + +include ${CURDIR}${G_FILESMK} +include $(addprefix ${SRCSDIR_$P},$(addsuffix ${G_DIRMK},${NEWDIRS})) + + +# restore + +CURDIR := ${CURDIR_$D} +SRCPATH := ${SRCPATH_$D} +DIRNAME := ${DIRNAME_$D} +D := ${D_$D} -SRCS += ${NEWSRCS} -OBJS += $(addprefix ${OBJSDIR},${NEWOBJS}) -DEPS += $(addprefix ${DEPSDIR},${NEWDEPS}) diff --git a/src/graphics/files.mk b/src/graphics/files.mk new file mode 100644 index 0000000..888ed59 --- /dev/null +++ b/src/graphics/files.mk @@ -0,0 +1,26 @@ + +NEWSRCS := # := start; empty + +NEWSRCS += graphics.cpp + +NEWDIRS := # := start; empty + +################################################################################ + +NEWSRCS := $(addprefix ${SRCPATH},${NEWSRCS}) +NEWDIRS := $(addprefix ${SRCPATH},${NEWDIRS}) +NEWOBJS := ${NEWSRCS:.cpp=.o} +NEWDEPS := ${NEWSRCS:.cpp=.d} + +NEWOBJSDIRS := $(addprefix ${OBJSDIR_$P},${NEWDIRS}) +NEWDEPSDIRS := $(addprefix ${DEPSDIR_$P},${NEWDIRS}) + +# Append to lists + +L_SRCS_$P += ${NEWSRCS} +L_OBJS_$P += $(addprefix ${OBJSDIR_$P},${NEWOBJS}) +L_DEPS_$P += $(addprefix ${DEPSDIR_$P},${NEWDEPS}) + +L_BLDDIRS_$P += ${NEWOBJSDIRS} +L_BLDDIRS_$P += ${NEWDEPSDIRS} + diff --git a/src/input/dir.mk b/src/input/dir.mk index a039bae..8577950 100644 --- a/src/input/dir.mk +++ b/src/input/dir.mk @@ -1,18 +1,40 @@ -NEWSRCS := # insure blank -NEWSRCS += inputManager.cpp +T_DIRNAME := input +################################################################################ -# Post dir setup +# save +T := $D_TEMP + DIRNAME_$T := ${DIRNAME} + D_$T := $D -CURDIR := input/ + DIRNAME := ${T_DIRNAME} + D := $D_${DIRNAME} -NEWSRCS := $(addprefix ${CURDIR},${NEWSRCS}) -NEWOBJS := ${NEWSRCS:.cpp=.o} -NEWDEPS := ${NEWSRCS:.cpp=.d} + DIRNAME_$D := ${DIRNAME_$T} + D_$D := ${D_$T} -# Append to lists + DIRNAME_$T := + D_$T := +T := + +T_DIRNAME := + +CURDIR_$D := ${CURDIR} +CURDIR := ${CURDIR_$D}${DIRNAME}/ + +SRCPATH_$D := ${SRCPATH} +SRCPATH := ${SRCPATH_$D}${DIRNAME}/ + + +include ${CURDIR}${G_FILESMK} +include $(addprefix ${SRCSDIR_$P},$(addsuffix ${G_DIRMK},${NEWDIRS})) + + +# restore + +CURDIR := ${CURDIR_$D} +SRCPATH := ${SRCPATH_$D} +DIRNAME := ${DIRNAME_$D} +D := ${D_$D} -SRCS += ${NEWSRCS} -OBJS += $(addprefix ${OBJSDIR},${NEWOBJS}) -DEPS += $(addprefix ${DEPSDIR},${NEWDEPS}) diff --git a/src/input/files.mk b/src/input/files.mk new file mode 100644 index 0000000..20c8b9e --- /dev/null +++ b/src/input/files.mk @@ -0,0 +1,26 @@ + +NEWSRCS := # := start; empty + +NEWSRCS += inputManager.cpp + +NEWDIRS := # := start; empty + +################################################################################ + +NEWSRCS := $(addprefix ${SRCPATH},${NEWSRCS}) +NEWDIRS := $(addprefix ${SRCPATH},${NEWDIRS}) +NEWOBJS := ${NEWSRCS:.cpp=.o} +NEWDEPS := ${NEWSRCS:.cpp=.d} + +NEWOBJSDIRS := $(addprefix ${OBJSDIR_$P},${NEWDIRS}) +NEWDEPSDIRS := $(addprefix ${DEPSDIR_$P},${NEWDIRS}) + +# Append to lists + +L_SRCS_$P += ${NEWSRCS} +L_OBJS_$P += $(addprefix ${OBJSDIR_$P},${NEWOBJS}) +L_DEPS_$P += $(addprefix ${DEPSDIR_$P},${NEWDEPS}) + +L_BLDDIRS_$P += ${NEWOBJSDIRS} +L_BLDDIRS_$P += ${NEWDEPSDIRS} + diff --git a/tvars.mk b/tvars.mk new file mode 100644 index 0000000..59015c1 --- /dev/null +++ b/tvars.mk @@ -0,0 +1,11 @@ + +${L_OBJS_$P} ${L_DEPS_$P}: CXX := ${CXX_$P} +${L_OBJS_$P} ${L_DEPS_$P}: CXXFLAGS := ${CXXFLAGS_$P} +${L_OBJS_$P} ${L_DEPS_$P}: INCFLAGS := ${INCFLAGS_$P} + ${L_DEPS_$P}: DEPSDIR := ${DEPSDIR_$P} + ${L_DEPS_$P}: OBJSDIR := ${OBJSDIR_$P} + +cleanbin-$P: BINDIR := ${BINDIR_$P} +cleanobjs-$P: OBJSDIR := ${OBJSDIR_$P} +cleandeps-$P: DEPSDIR := ${DEPSDIR_$P} + diff --git a/vars.mk b/vars.mk new file mode 100644 index 0000000..3390067 --- /dev/null +++ b/vars.mk @@ -0,0 +1,62 @@ + +CXX_$P := ${G_CXX} +CXXFLAGS_$P := ${G_CXXFLAGS} +LNKFLAGS_$P := ${G_LNKFLAGS} -Wl,-rpath,libs/ -rdynamic +LIBS_$P := ${G_LIBSDL} ${G_LIBGL} -lbear + +SRCSDIR_$P := ${CURDIR}${G_SRCSDIR} +DEPSDIR_$P := ${CURDIR}${G_DEPSDIR} +OBJSDIR_$P := ${CURDIR}${G_OBJSDIR} +BINDIR_$P := ${CURDIR}${G_BINDIR} + +# HACK +T_INCDIRS_$P := ${SRCSDIR_$P} # lib/inc/ + INCFLAGS_$P := $(addprefix -I, ${T_INCDIRS_$P}) +T_INCDIRS_$P := # empty + +CFGDIRNAME_$P := configs/ +SRCCFGDIR_$P := ${CURDIR}${CFGDIRNAME_$P} +DSTCFGDIR_$P := ${BINDIR_$P}${CFGDIRNAME_$P} + +CFGS_$P := # := start +CFGS_$P += keys.cfg +CFGS_$P := $(addprefix ${DSTCFGDIR_$P},${CFGS_$P}) + +LIBSDIRNAME_$P := libs/ +SRCLIBSDIR_$P := ${CURDIR}${LIBSDIRNAME_$P} +ifeq (${BUILD},WIN32) + DSTLIBSDIR_$P := ${BINDIR_$P} +else + DSTLIBSDIR_$P := ${BINDIR_$P}${LIBSDIRNAME_$P} +endif + +LIBSTXT_$P := # := start +LIBSTXT_$P += COPYING-SDL +LIBSTXT_$P += README-SDL +LIBSTXT_$P += VERSION-SDL +LIBSTXT_$P := $(addprefix ${DSTLIBSDIR_$P},${LIBSTXT_$P}) + +LIBSCPY_$P := # := start +ifeq (${BUILD},WIN32) + LIBSCPY_$P += SDL.dll + LIBSCPY_$P += bear.dll +else + LIBSCPY_$P += libSDL-1.2.so.0 + LIBSCPY_$P += libbear.so.0 +endif +LIBSCPY_$P := $(addprefix ${DSTLIBSDIR_$P},${LIBSCPY_$P}) + +SRCTXTDIR_$P := ${CURDIR} +DSTTXTDIR_$P := ${BINDIR_$P} + +TXT_$P := # := start +TXT_$P += COPYING +TXT_$P := $(addprefix ${DSTTXTDIR_$P},${TXT_$P}) + +ifeq (${BUILD},WIN32) + TARGETNAME_$P := run_physics.exe +else + TARGETNAME_$P := run_physics +endif +TARGETTMP_$P := ${OBJSDIR_$P}${TARGETNAME_$P} +TARGET_$P := ${BINDIR_$P}${TARGETNAME_$P} -- 2.10.2