From 42f62a7503a4d516020b6222eecb3a30ccc66127 Mon Sep 17 00:00:00 2001 From: Patrik Gornicz Date: Sun, 28 Sep 2008 20:05:38 -0400 Subject: [PATCH] using make to create the objs and deps directories --- .gitignore | 2 ++ deps/.gitignore | 1 - deps/Effects/.tmp | 2 -- deps/Entities/.tmp | 2 -- deps/GameStates/.tmp | 2 -- deps/config/.tmp | 2 -- deps/graphics/.tmp | 2 -- deps/input/.tmp | 2 -- objs/.gitignore | 1 - objs/Effects/.tmp | 2 -- objs/Entities/.tmp | 2 -- objs/GameStates/.tmp | 2 -- objs/config/.tmp | 2 -- objs/graphics/.tmp | 2 -- objs/input/.tmp | 2 -- src/Makefile | 12 ++++++++++-- 16 files changed, 12 insertions(+), 28 deletions(-) delete mode 100644 deps/.gitignore delete mode 100644 deps/Effects/.tmp delete mode 100644 deps/Entities/.tmp delete mode 100644 deps/GameStates/.tmp delete mode 100644 deps/config/.tmp delete mode 100644 deps/graphics/.tmp delete mode 100644 deps/input/.tmp delete mode 100644 objs/.gitignore delete mode 100644 objs/Effects/.tmp delete mode 100644 objs/Entities/.tmp delete mode 100644 objs/GameStates/.tmp delete mode 100644 objs/config/.tmp delete mode 100644 objs/graphics/.tmp delete mode 100644 objs/input/.tmp diff --git a/.gitignore b/.gitignore index 9f42e7f..20d0e14 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ run_physics +objs +deps diff --git a/deps/.gitignore b/deps/.gitignore deleted file mode 100644 index a438335..0000000 --- a/deps/.gitignore +++ /dev/null @@ -1 +0,0 @@ -*.d diff --git a/deps/Effects/.tmp b/deps/Effects/.tmp deleted file mode 100644 index 69d9e5c..0000000 --- a/deps/Effects/.tmp +++ /dev/null @@ -1,2 +0,0 @@ -# This file is needed for git to include the current directory into the -# repository ... ideas? diff --git a/deps/Entities/.tmp b/deps/Entities/.tmp deleted file mode 100644 index 69d9e5c..0000000 --- a/deps/Entities/.tmp +++ /dev/null @@ -1,2 +0,0 @@ -# This file is needed for git to include the current directory into the -# repository ... ideas? diff --git a/deps/GameStates/.tmp b/deps/GameStates/.tmp deleted file mode 100644 index 69d9e5c..0000000 --- a/deps/GameStates/.tmp +++ /dev/null @@ -1,2 +0,0 @@ -# This file is needed for git to include the current directory into the -# repository ... ideas? diff --git a/deps/config/.tmp b/deps/config/.tmp deleted file mode 100644 index 69d9e5c..0000000 --- a/deps/config/.tmp +++ /dev/null @@ -1,2 +0,0 @@ -# This file is needed for git to include the current directory into the -# repository ... ideas? diff --git a/deps/graphics/.tmp b/deps/graphics/.tmp deleted file mode 100644 index 69d9e5c..0000000 --- a/deps/graphics/.tmp +++ /dev/null @@ -1,2 +0,0 @@ -# This file is needed for git to include the current directory into the -# repository ... ideas? diff --git a/deps/input/.tmp b/deps/input/.tmp deleted file mode 100644 index 69d9e5c..0000000 --- a/deps/input/.tmp +++ /dev/null @@ -1,2 +0,0 @@ -# This file is needed for git to include the current directory into the -# repository ... ideas? diff --git a/objs/.gitignore b/objs/.gitignore deleted file mode 100644 index 5761abc..0000000 --- a/objs/.gitignore +++ /dev/null @@ -1 +0,0 @@ -*.o diff --git a/objs/Effects/.tmp b/objs/Effects/.tmp deleted file mode 100644 index 69d9e5c..0000000 --- a/objs/Effects/.tmp +++ /dev/null @@ -1,2 +0,0 @@ -# This file is needed for git to include the current directory into the -# repository ... ideas? diff --git a/objs/Entities/.tmp b/objs/Entities/.tmp deleted file mode 100644 index 69d9e5c..0000000 --- a/objs/Entities/.tmp +++ /dev/null @@ -1,2 +0,0 @@ -# This file is needed for git to include the current directory into the -# repository ... ideas? diff --git a/objs/GameStates/.tmp b/objs/GameStates/.tmp deleted file mode 100644 index 69d9e5c..0000000 --- a/objs/GameStates/.tmp +++ /dev/null @@ -1,2 +0,0 @@ -# This file is needed for git to include the current directory into the -# repository ... ideas? diff --git a/objs/config/.tmp b/objs/config/.tmp deleted file mode 100644 index 69d9e5c..0000000 --- a/objs/config/.tmp +++ /dev/null @@ -1,2 +0,0 @@ -# This file is needed for git to include the current directory into the -# repository ... ideas? diff --git a/objs/graphics/.tmp b/objs/graphics/.tmp deleted file mode 100644 index 69d9e5c..0000000 --- a/objs/graphics/.tmp +++ /dev/null @@ -1,2 +0,0 @@ -# This file is needed for git to include the current directory into the -# repository ... ideas? diff --git a/objs/input/.tmp b/objs/input/.tmp deleted file mode 100644 index 69d9e5c..0000000 --- a/objs/input/.tmp +++ /dev/null @@ -1,2 +0,0 @@ -# This file is needed for git to include the current directory into the -# repository ... ideas? diff --git a/src/Makefile b/src/Makefile index 1ebf227..14cc64b 100644 --- a/src/Makefile +++ b/src/Makefile @@ -35,6 +35,9 @@ DEPSDIR := ../deps/ DEPS := ${SRCS:.cpp=.d} DEPS := $(addprefix ${DEPSDIR},${DEPS}) +BLDDIRS := $(addprefix ${DEPSDIR},${DIRS}) $(addprefix ${OBJSDIR},${DIRS}) +BLDDIRS := $(addsuffix /,${BLDDIRS}) + VERBOSE := 0 @@ -53,17 +56,22 @@ endif .PHONY: all all: ${TARGET} +# how to link the main target ${TARGET}: ${OBJS} ${Q1}echo "${CXX}: $@" ${Q2}${CXX} ${CXXFLAGS} -o $@ $^ ${LIBS} +# how to make a directory +${BLDDIRS}: + ${Q2}mkdir -p $@ + # rule to make a depend file from a .cpp -${DEPSDIR}%.d: %.cpp +${DEPSDIR}%.d: %.cpp | ${BLDDIRS} ${Q1}echo "DEP: $@" ${Q2}${CXX} -MM ${CXXFLAGS} $< | sed 's,\(^.*\):,${OBJSDIR}\1 $@:,' > $@ # rule to make an object file from a .cpp -${OBJSDIR}%.o: %.cpp +${OBJSDIR}%.o: %.cpp | ${BLDDIRS} ${Q1}echo "${CXX}: $@" ${Q2}${CXX} ${CXXFLAGS} -c -o $@ $< -- 2.10.2