From f4b779e42fa07ab66aec420e735a559dec1a7a90 Mon Sep 17 00:00:00 2001 From: Patrik Gornicz Date: Sun, 17 Aug 2008 20:52:40 -0400 Subject: [PATCH] changed Makefile to use deps and objs directories --- src/Makefile | 17 +++++++++++------ {src/templates => templates}/template.cpp | 0 {src/templates => templates}/template.h | 0 3 files changed, 11 insertions(+), 6 deletions(-) rename {src/templates => templates}/template.cpp (100%) rename {src/templates => templates}/template.h (100%) diff --git a/src/Makefile b/src/Makefile index 2c1cf92..6ab9af2 100644 --- a/src/Makefile +++ b/src/Makefile @@ -49,8 +49,13 @@ SRCS += input/inputManager.cpp SRCS += graphics/graphics.cpp +OBJSDIR := ../objs/ OBJS := ${SRCS:.cpp=.o} -DEPENDS := ${SRCS:.cpp=.d} +OBJS := $(addprefix ${OBJSDIR},${OBJS}) + +DEPSDIR := ../deps/ +DEPS := ${SRCS:.cpp=.d} +DEPS := $(addprefix ${DEPSDIR},${DEPS}) HRDS := ${SRCS:.cpp=.h} HRDS := ${HRDS:main.h=} # remove main.h @@ -83,12 +88,12 @@ ${TARGET}: ${OBJS} ${Q2}${CXX} ${CXXFLAGS} -o ${TARGET} $^ ${LIBS} # rule to make a depend file from a .cpp -%.d: %.cpp +${DEPSDIR}%.d: %.cpp ${Q1}echo "DEP: $@" ${Q2}${CXX} -M ${CXXFLAGS} $< | sed 's,: , $@: ,' > $@ # rule to make an object file from a .cpp -%.o: %.cpp +${OBJSDIR}%.o: %.cpp ${Q1}echo "${CXX}: $@" ${Q2}${CXX} ${CXXFLAGS} -c -o $@ $< @@ -102,8 +107,8 @@ clean: .PHONY: distclean distclean: clean - ${Q1}echo "CLEAN: DEPENDS" - ${Q2}rm -f ${DEPENDS} + ${Q1}echo "CLEAN: DEPS" + ${Q2}rm -f ${DEPS} ${Q1}echo "CLEAN: tags prof gmon.out" ${Q2}rm -f tags prof gmon.out @@ -141,4 +146,4 @@ prof: all gprof -b ${TARGET} > prof kprof -f prof --include ${DEPENDS} +-include ${DEPS} diff --git a/src/templates/template.cpp b/templates/template.cpp similarity index 100% rename from src/templates/template.cpp rename to templates/template.cpp diff --git a/src/templates/template.h b/templates/template.h similarity index 100% rename from src/templates/template.h rename to templates/template.h -- 2.10.2