From a99c6699cce56e848ab22ec68b2fc4c9611e03d2 Mon Sep 17 00:00:00 2001 From: Patrik Gornicz Date: Sat, 13 Jun 2009 13:24:17 -0400 Subject: [PATCH] clean now cleans bin, mkdir does not use -p --- lib/rules.mk | 6 ++---- lib/src/files.mk | 10 ++++++++-- lib/src/locks/files.mk | 10 ++++++++-- tests/rules.mk | 6 ++---- tests/src/1/files.mk | 10 ++++++++-- tests/src/1/tvars.mk | 1 - tests/src/files.mk | 10 ++++++++-- tests/src/printTrace/files.mk | 10 ++++++++-- tests/src/printTrace/tvars.mk | 1 - 9 files changed, 44 insertions(+), 20 deletions(-) diff --git a/lib/rules.mk b/lib/rules.mk index aae1039..5f9919a 100644 --- a/lib/rules.mk +++ b/lib/rules.mk @@ -33,7 +33,7 @@ ${TARGET_$P}: ${TARGETTMP_$P} | $${@D} # how to make a directory ${L_BLDDIRS_$P}: ${Q1}${PRNTFMT} "mkdir" "$@" - ${Q2}mkdir -p $@ + ${Q2}mkdir $@ # rule to make an object file from a .cpp ${OBJSDIR_$P}%.o: ${SRCSDIR_$P}%.cpp | $${@D} @@ -72,9 +72,7 @@ $P-cleandeps: L_CLEANCMDS += $P-clean clean: $P-clean .PHONY: $P-clean -$P-clean: $P-cleanobjs - ${Q1}${PRNTFMT} "rm" "${TARGET}" - ${Q2}rm -f ${TARGET} +$P-clean: $P-cleanobjs $P-cleanbin L_CLEANCMDS += $P-cleanall cleanall: $P-cleanall diff --git a/lib/src/files.mk b/lib/src/files.mk index 96bd6b9..b044e3d 100644 --- a/lib/src/files.mk +++ b/lib/src/files.mk @@ -16,12 +16,18 @@ NEWDIRS := $(addprefix ${SRCPATH},${NEWDIRS}) NEWOBJS := ${NEWSRCS:.cpp=.o} NEWDEPS := ${NEWSRCS:.cpp=.d} +NEWOBJSDIRS := $(addprefix ${OBJSDIR_$P},${NEWDIRS}) +NEWDEPSDIRS := $(addprefix ${DEPSDIR_$P},${NEWDIRS}) + +${NEWOBJSDIRS}: | $${@D} +${NEWDEPSDIRS}: | $${@D} + # Append to lists L_SRCS_$P += ${NEWSRCS} L_OBJS_$P += $(addprefix ${OBJSDIR_$P},${NEWOBJS}) L_DEPS_$P += $(addprefix ${DEPSDIR_$P},${NEWDEPS}) -L_BLDDIRS_$P += $(addprefix ${OBJSDIR_$P},${NEWDIRS}) -L_BLDDIRS_$P += $(addprefix ${DEPSDIR_$P},${NEWDIRS}) +L_BLDDIRS_$P += ${NEWOBJSDIRS} +L_BLDDIRS_$P += ${NEWDEPSDIRS} diff --git a/lib/src/locks/files.mk b/lib/src/locks/files.mk index c77058f..907c61f 100644 --- a/lib/src/locks/files.mk +++ b/lib/src/locks/files.mk @@ -12,12 +12,18 @@ NEWDIRS := $(addprefix ${SRCPATH},${NEWDIRS}) NEWOBJS := ${NEWSRCS:.cpp=.o} NEWDEPS := ${NEWSRCS:.cpp=.d} +NEWOBJSDIRS := $(addprefix ${OBJSDIR_$P},${NEWDIRS}) +NEWDEPSDIRS := $(addprefix ${DEPSDIR_$P},${NEWDIRS}) + +${NEWOBJSDIRS}: | $${@D} +${NEWDEPSDIRS}: | $${@D} + # Append to lists L_SRCS_$P += ${NEWSRCS} L_OBJS_$P += $(addprefix ${OBJSDIR_$P},${NEWOBJS}) L_DEPS_$P += $(addprefix ${DEPSDIR_$P},${NEWDEPS}) -L_BLDDIRS_$P += $(addprefix ${OBJSDIR_$P},${NEWDIRS}) -L_BLDDIRS_$P += $(addprefix ${DEPSDIR_$P},${NEWDIRS}) +L_BLDDIRS_$P += ${NEWOBJSDIRS} +L_BLDDIRS_$P += ${NEWDEPSDIRS} diff --git a/tests/rules.mk b/tests/rules.mk index b85e0d8..1be2644 100644 --- a/tests/rules.mk +++ b/tests/rules.mk @@ -10,7 +10,7 @@ tests/bind/libbear.so.0: lib/bind/libbear.so.0.0 | $${@D} # how to make a directory ${L_BLDDIRS_$P}: ${Q1}${PRNTFMT} "mkdir" "$@" - ${Q2}mkdir -p $@ + ${Q2}mkdir $@ # rule to make an object file from a .cpp ${OBJSDIR_$P}%.o: ${SRCSDIR_$P}%.cpp | $${@D} @@ -49,9 +49,7 @@ $P-cleandeps: L_CLEANCMDS += $P-clean clean: $P-clean .PHONY: $P-clean -$P-clean: $P-cleanobjs - ${Q1}${PRNTFMT} "rm" "${TARGET}" - ${Q2}rm -f ${TARGET} +$P-clean: $P-cleanobjs $P-cleanbin L_CLEANCMDS += $P-cleanall cleanall: $P-cleanall diff --git a/tests/src/1/files.mk b/tests/src/1/files.mk index 40c479a..2035aff 100644 --- a/tests/src/1/files.mk +++ b/tests/src/1/files.mk @@ -11,12 +11,18 @@ NEWDIRS := $(addprefix ${SRCPATH},${NEWDIRS}) NEWOBJS := ${NEWSRCS:.cpp=.o} NEWDEPS := ${NEWSRCS:.cpp=.d} +NEWOBJSDIRS := $(addprefix ${OBJSDIR_$P},${NEWDIRS}) +NEWDEPSDIRS := $(addprefix ${DEPSDIR_$P},${NEWDIRS}) + +${NEWOBJSDIRS}: | $${@D} +${NEWDEPSDIRS}: | $${@D} + # Append to lists L_SRCS_$D += ${NEWSRCS} L_OBJS_$D += $(addprefix ${OBJSDIR_$P},${NEWOBJS}) L_DEPS_$D += $(addprefix ${DEPSDIR_$P},${NEWDEPS}) -L_BLDDIRS_$P += $(addprefix ${OBJSDIR_$P},${NEWDIRS}) -L_BLDDIRS_$P += $(addprefix ${DEPSDIR_$P},${NEWDIRS}) +L_BLDDIRS_$P += ${NEWOBJSDIRS} +L_BLDDIRS_$P += ${NEWDEPSDIRS} diff --git a/tests/src/1/tvars.mk b/tests/src/1/tvars.mk index cda0e6f..90060bc 100644 --- a/tests/src/1/tvars.mk +++ b/tests/src/1/tvars.mk @@ -4,4 +4,3 @@ ${TARGETTMP_$D}: CXXFLAGS := ${CXXFLAGS_$D} ${TARGETTMP_$D}: LNKFLAGS := ${LNKFLAGS_$D} ${TARGETTMP_$D}: LIBS := ${LIBS_$D} -$P-clean: TARGET := ${TARGET_$D} diff --git a/tests/src/files.mk b/tests/src/files.mk index 527718d..d430018 100644 --- a/tests/src/files.mk +++ b/tests/src/files.mk @@ -13,12 +13,18 @@ NEWDIRS := $(addprefix ${SRCPATH},${NEWDIRS}) NEWOBJS := ${NEWSRCS:.cpp=.o} NEWDEPS := ${NEWSRCS:.cpp=.d} +NEWOBJSDIRS := $(addprefix ${OBJSDIR_$P},${NEWDIRS}) +NEWDEPSDIRS := $(addprefix ${DEPSDIR_$P},${NEWDIRS}) + +${NEWOBJSDIRS}: | $${@D} +${NEWDEPSDIRS}: | $${@D} + # Append to lists L_SRCS_$P += ${NEWSRCS} L_OBJS_$P += $(addprefix ${OBJSDIR_$P},${NEWOBJS}) L_DEPS_$P += $(addprefix ${DEPSDIR_$P},${NEWDEPS}) -L_BLDDIRS_$P += $(addprefix ${OBJSDIR_$P},${NEWDIRS}) -L_BLDDIRS_$P += $(addprefix ${DEPSDIR_$P},${NEWDIRS}) +L_BLDDIRS_$P += ${NEWOBJSDIRS} +L_BLDDIRS_$P += ${NEWDEPSDIRS} diff --git a/tests/src/printTrace/files.mk b/tests/src/printTrace/files.mk index 40c479a..2035aff 100644 --- a/tests/src/printTrace/files.mk +++ b/tests/src/printTrace/files.mk @@ -11,12 +11,18 @@ NEWDIRS := $(addprefix ${SRCPATH},${NEWDIRS}) NEWOBJS := ${NEWSRCS:.cpp=.o} NEWDEPS := ${NEWSRCS:.cpp=.d} +NEWOBJSDIRS := $(addprefix ${OBJSDIR_$P},${NEWDIRS}) +NEWDEPSDIRS := $(addprefix ${DEPSDIR_$P},${NEWDIRS}) + +${NEWOBJSDIRS}: | $${@D} +${NEWDEPSDIRS}: | $${@D} + # Append to lists L_SRCS_$D += ${NEWSRCS} L_OBJS_$D += $(addprefix ${OBJSDIR_$P},${NEWOBJS}) L_DEPS_$D += $(addprefix ${DEPSDIR_$P},${NEWDEPS}) -L_BLDDIRS_$P += $(addprefix ${OBJSDIR_$P},${NEWDIRS}) -L_BLDDIRS_$P += $(addprefix ${DEPSDIR_$P},${NEWDIRS}) +L_BLDDIRS_$P += ${NEWOBJSDIRS} +L_BLDDIRS_$P += ${NEWDEPSDIRS} diff --git a/tests/src/printTrace/tvars.mk b/tests/src/printTrace/tvars.mk index cda0e6f..90060bc 100644 --- a/tests/src/printTrace/tvars.mk +++ b/tests/src/printTrace/tvars.mk @@ -4,4 +4,3 @@ ${TARGETTMP_$D}: CXXFLAGS := ${CXXFLAGS_$D} ${TARGETTMP_$D}: LNKFLAGS := ${LNKFLAGS_$D} ${TARGETTMP_$D}: LIBS := ${LIBS_$D} -$P-clean: TARGET := ${TARGET_$D} -- 2.10.2