From: Patrik Gornicz Date: Mon, 18 May 2009 21:09:56 +0000 (-0400) Subject: small change to directory handling in Makefile X-Git-Tag: libbear-premerge~86 X-Git-Url: http://gitweb.pgornicz.com/?a=commitdiff_plain;h=069e9fcfe59cf7f6563ba7c624854192ab5ed209;p=libbear.git small change to directory handling in Makefile --- 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 $@):/' > $@