Index: share/mk/bsd.obj.mk =================================================================== --- share/mk/bsd.obj.mk +++ share/mk/bsd.obj.mk @@ -81,14 +81,16 @@ .if !defined(NO_OBJ) .if !target(obj) obj: .PHONY - @if ! test -d ${CANONICALOBJDIR}/; then \ - mkdir -p ${CANONICALOBJDIR}; \ - if ! test -d ${CANONICALOBJDIR}/; then \ - ${ECHO} "Unable to create ${CANONICALOBJDIR}."; \ +.for dir in ${CANONICALOBJDIR} ${EXTRA_OBJDIRS:S/^/${CANONICALOBJDIR}\/&/} + @if ! test -d ${dir}/; then \ + mkdir -p ${dir}; \ + if ! test -d ${dir}/; then \ + ${ECHO} "Unable to create ${dir}."; \ exit 1; \ fi; \ - ${ECHO} "${CANONICALOBJDIR} created for ${.CURDIR}"; \ + ${ECHO} "${CANONICALOBJDIR}${dir} created for ${.CURDIR}${dir}"; \ fi +.endfor .endif .if !target(objlink)