From 069e9fcfe59cf7f6563ba7c624854192ab5ed209 Mon Sep 17 00:00:00 2001 From: Patrik Gornicz Date: Mon, 18 May 2009 17:09:56 -0400 Subject: [PATCH] small change to directory handling in Makefile --- Makefile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 2cf55b0..92ae7d2 100644 --- a/Makefile +++ b/Makefile @@ -144,16 +144,16 @@ uninstall: rm /usr/lib/${LINKERNAME} rm /usr/lib/${SONAME} -# cause the fancy $$ directory rules to work out +# cause the fancy $${@D} directory rules to work out .SECONDEXPANSION: # how to link the main target -${TARGETTMP}: ${OBJS} +${TARGETTMP}: ${OBJS} | $${@D} ${Q1}${PRNTFMT} "${CXX}" "$@" ${Q2}${CXX} ${CXXFLAGS} ${LNKFLAGS} -o $@ $^ ${LIBS} # rule to copy tmp target to working directory -${TARGET}: ${TARGETTMP} | ${WORKINGDIR} +${TARGET}: ${TARGETTMP} | $${@D} ${Q1}${PRNTFMT} "cp" "$@" ${Q2}cp $< $@ @@ -163,14 +163,14 @@ ${BLDDIRS}: ${Q2}mkdir -p $@ # rule to make an object file from a .cpp -${OBJSDIR}%.o: ${SRCSDIR}%.cpp | $$(dir $$@) +${OBJSDIR}%.o: ${SRCSDIR}%.cpp | $${@D} ${Q1}${PRNTFMT} "${CXX}" "$@" ${Q2}${CXX} ${CXXFLAGS} -c -o $@ $< ${INCFLAGS} # rule to make a depend file from a .cpp # be clever and escape the / chars in file paths # DON'T simply use another sed delimiter or it can't appear in the file paths -${DEPSDIR}%.d: ${SRCSDIR}%.cpp | $$(dir $$@) +${DEPSDIR}%.d: ${SRCSDIR}%.cpp | $${@D} ${Q1}${PRNTFMT} "DEP" "$@" ${Q2}${CXX} -MM ${CXXFLAGS} $< ${INCFLAGS} | \ sed 's/\(^.*\):/$(subst /,\/,${OBJSDIR}\1 $@):/' > $@ -- 2.10.2