Don't special case i386/pc98, replace it with the smarter logic

of setting ${TARGET} -- make it default to ${MACHINE} if we are
not cross-building, and ${TARGET_ARCH} otherwise.

Set MAKEOBJDIREPREFIX based on ${TARGET}, not on ${TARGET_ARCH}.
This is useful if you want to cross-build pc98 worlds on i386.
This commit is contained in:
ru 2002-04-11 13:43:50 +00:00
parent 9d36b38cd7
commit d2541f3387

View File

@ -123,17 +123,21 @@ SUPFLAGS+= -h ${SUPHOST}
MAKEOBJDIRPREFIX?= /usr/obj
TARGET_ARCH?= ${MACHINE_ARCH}
.if ${TARGET_ARCH} == ${MACHINE_ARCH}
TARGET?= ${MACHINE}
.else
TARGET?= ${TARGET_ARCH}
.endif
.if make(buildworld)
BUILD_ARCH!= sysctl -n hw.machine_arch
.if ${MACHINE_ARCH} != ${BUILD_ARCH}
.error To cross-build, set TARGET_ARCH.
.endif
.endif
.if ${MACHINE_ARCH} == ${TARGET_ARCH}
.if ${MACHINE} == ${TARGET}
OBJTREE= ${MAKEOBJDIRPREFIX}
.else
OBJTREE= ${MAKEOBJDIRPREFIX}/${TARGET_ARCH}
OBJTREE= ${MAKEOBJDIRPREFIX}/${TARGET}
.endif
WORLDTMP= ${OBJTREE}${.CURDIR}/${MACHINE_ARCH}
# /usr/games added for fortune which depend on strfile
@ -375,13 +379,6 @@ KERNCONF?= GENERIC
.endif
INSTKERNNAME?= kernel
# The only exotic TARGET_ARCH/TARGET combination valid at this
# time is i386/pc98. In all other cases set TARGET equal to
# TARGET_ARCH.
.if ${TARGET_ARCH} != "i386" || ${TARGET} != "pc98"
TARGET= ${TARGET_ARCH}
.endif
KRNLSRCDIR= ${.CURDIR}/sys
KRNLCONFDIR= ${KRNLSRCDIR}/${TARGET}/conf
KRNLOBJDIR= ${OBJTREE}${KRNLSRCDIR}