Affix the ${HOST_OSTYPE} info to the end of the objdir name if OBJMACHINE

is set (and MAKEOBJDIR[PREFIX] is not in use).  This permits multiple hosts
to compile hostprogs (not just src/tools) for a given target without
colliding with each other.

Currently restricted only to new toolchain builds, as this requires a new
make(1) in order to function properly.
This commit is contained in:
tv 2001-11-11 23:19:14 +00:00
parent e7e8f27d5f
commit 2e00400b7f
2 changed files with 21 additions and 13 deletions

View File

@ -1,4 +1,4 @@
\# $NetBSD: bsd.hostprog.mk,v 1.17 2001/11/02 05:21:50 tv Exp $
\# $NetBSD: bsd.hostprog.mk,v 1.18 2001/11/11 23:19:14 tv Exp $
# @(#)bsd.prog.mk 8.2 (Berkeley) 4/2/94
.include <bsd.init.mk>
@ -49,6 +49,10 @@ LIBZ?= /usr/lib/libz.a
CFLAGS+= ${COPTS}
.if defined(USE_NEW_TOOLCHAIN)
OBJHOSTMACHINE= # set
.endif
##### Build rules
.if defined(SHAREDSTRINGS)
CLEANFILES+=strings

View File

@ -1,4 +1,4 @@
# $NetBSD: bsd.obj.mk,v 1.31 2001/11/11 23:07:26 tv Exp $
# $NetBSD: bsd.obj.mk,v 1.32 2001/11/11 23:19:14 tv Exp $
.if !target(__initialized_obj__)
__initialized_obj__:
@ -28,25 +28,29 @@ obj:
echo "${__curdir} -> ${__objdir}"; \
fi
.else
.if defined(OBJMACHINE)
__objdir= obj.${MACHINE}
.else
__objdir= obj
.endif
PAWD?= /bin/pwd
__objdir= obj${OBJMACHINE:D.${MACHINE}}
.if defined(USR_OBJMACHINE)
__usrobjdir= ${BSDOBJDIR}.${MACHINE}
__usrobjdirpf=
.else
__usrobjdir= ${BSDOBJDIR}
.if defined(OBJMACHINE)
__usrobjdirpf= .${MACHINE}
.else
__usrobjdirpf=
.endif
__usrobjdirpf= ${OBJMACHINE:D.${MACHINE}}
.endif
PAWD?= /bin/pwd
.if defined(OBJMACHINE) && defined(OBJHOSTMACHINE)
# In case .CURDIR has been twiddled by a .mk file and is now relative,
# make it absolute again.
.if ${.CURDIR:M/*} == ""
.CURDIR!= ${PAWD}
.endif
__objdir:= ${__objdir}.${HOST_OSTYPE}
__usrobjdirpf:= ${__usrobjdirpf}.${HOST_OSTYPE}
.OBJDIR: ${__objdir}
.endif
obj:
@cd ${__curdir}; \