From 084b12f5731400078e7264701f5546f981818451 Mon Sep 17 00:00:00 2001 From: Patrik Gornicz Date: Sun, 7 Jun 2009 16:04:29 -0400 Subject: [PATCH] cleaned up internal makefile paths --- Makefile | 7 ------- src/dir.mk | 19 ++++++++++--------- src/files.mk | 4 ++-- src/locks/dir.mk | 5 +++-- src/locks/files.mk | 4 ++-- src/vars.mk | 11 +++++++++++ 6 files changed, 28 insertions(+), 22 deletions(-) diff --git a/Makefile b/Makefile index 737559d..3921dde 100644 --- a/Makefile +++ b/Makefile @@ -17,13 +17,6 @@ RULESMK := rules.mk include ${VARSMK} -# lists populated by dir.mk files in subdirectories -SRCS := # := start -OBJS := # := start -DEPS := # := start - -BLDDIRS := # := start - # include all of the dir.mk include src/${DIRMK} diff --git a/src/dir.mk b/src/dir.mk index 2f1a642..d9cbf1c 100644 --- a/src/dir.mk +++ b/src/dir.mk @@ -1,17 +1,18 @@ -CURDIR := - -include src/${VARSMK} -include src/${FILESMK} -include $(addprefix ${SRCSDIR},$(addsuffix ${DIRMK},${NEWDIRS})) +CURDIR := src/ +SRCPATH := +include ${CURDIR}${VARSMK} +include ${CURDIR}${FILESMK} -BLDDIRS += ${OBJSDIR} -BLDDIRS += ${DEPSDIR} -BLDDIRS += ${WORKINGDIR} +# steps on variables +include $(addprefix ${SRCSDIR},$(addsuffix ${DIRMK},${NEWDIRS})) +# Restore variables +CURDIR := src/ +SRCPATH := -include src/${RULESMK} +include ${CURDIR}${RULESMK} # Do not include deps files when doing a clean operation ifeq ($(filter ${CLEANCMDS},${MAKECMDGOALS}),) diff --git a/src/files.mk b/src/files.mk index f5bef4f..10c0f64 100644 --- a/src/files.mk +++ b/src/files.mk @@ -11,8 +11,8 @@ NEWDIRS += locks/ ################################################################################ -NEWSRCS := $(addprefix ${CURDIR},${NEWSRCS}) -NEWDIRS := $(addprefix ${CURDIR},${NEWDIRS}) +NEWSRCS := $(addprefix ${SRCPATH},${NEWSRCS}) +NEWDIRS := $(addprefix ${SRCPATH},${NEWDIRS}) NEWOBJS := ${NEWSRCS:.cpp=.o} NEWDEPS := ${NEWSRCS:.cpp=.d} diff --git a/src/locks/dir.mk b/src/locks/dir.mk index 875cfae..5af7edd 100644 --- a/src/locks/dir.mk +++ b/src/locks/dir.mk @@ -1,5 +1,6 @@ -CURDIR := locks/ +CURDIR := src/locks/ +SRCPATH := locks/ -include src/locks/${FILESMK} +include ${CURDIR}${FILESMK} include $(addprefix ${SRCSDIR},$(addsuffix ${DIRMK},${NEWDIRS})) diff --git a/src/locks/files.mk b/src/locks/files.mk index 61b36a6..58c2cd8 100644 --- a/src/locks/files.mk +++ b/src/locks/files.mk @@ -7,8 +7,8 @@ NEWDIRS := # := start; empty ################################################################################ -NEWSRCS := $(addprefix ${CURDIR},${NEWSRCS}) -NEWDIRS := $(addprefix ${CURDIR},${NEWDIRS}) +NEWSRCS := $(addprefix ${SRCPATH},${NEWSRCS}) +NEWDIRS := $(addprefix ${SRCPATH},${NEWDIRS}) NEWOBJS := ${NEWSRCS:.cpp=.o} NEWDEPS := ${NEWSRCS:.cpp=.d} diff --git a/src/vars.mk b/src/vars.mk index f26a344..1b1eb80 100644 --- a/src/vars.mk +++ b/src/vars.mk @@ -75,3 +75,14 @@ ${TARGET}: CXXFLAGS += ${DBGFLAGS} endif endif +# lists populated by dir.mk files in subdirectories +SRCS := # := start +OBJS := # := start +DEPS := # := start + +BLDDIRS := # := start + +BLDDIRS += ${OBJSDIR} +BLDDIRS += ${DEPSDIR} +BLDDIRS += ${WORKINGDIR} + -- 2.10.2