# 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}
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
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}
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}
# 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}
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
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}
${TARGETTMP_$D}: LNKFLAGS := ${LNKFLAGS_$D}
${TARGETTMP_$D}: LIBS := ${LIBS_$D}
-$P-clean: TARGET := ${TARGET_$D}
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}
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}
${TARGETTMP_$D}: LNKFLAGS := ${LNKFLAGS_$D}
${TARGETTMP_$D}: LIBS := ${LIBS_$D}
-$P-clean: TARGET := ${TARGET_$D}