Fix check from r287867 for valid MAKEOBJDIR from top-level builds.

MAKEOBJDIR is based on OBJTOP so cannot be expanded until OBJTOP is set.

Reported by:	Nikolai Lifanov <lifanov@mail.lifanov.com>
Sponsored by:	EMC / Isilon Storage Division
This commit is contained in:
Bryan Drewery 2015-09-16 19:58:04 +00:00
parent d6043e4643
commit bf7ff1d2bf

View File

@ -7,6 +7,8 @@
# we need this until there is an alternative
MK_INSTALL_AS_USER= yes
_default_makeobjdir=$${.CURDIR:S,$${SRCTOP},$${OBJTOP},}
.if empty(OBJROOT) || ${.MAKE.LEVEL} == 0
.if !make(showconfig)
.if defined(MAKEOBJDIRPREFIX) && exists(${MAKEOBJDIRPREFIX})
@ -16,7 +18,6 @@ OBJROOT:=${MAKEOBJDIRPREFIX}${SRCTOP:S,/src,,}/
MAKEOBJDIRPREFIX=
.export MAKEOBJDIRPREFIX
.endif
_default_makeobjdir=$${.CURDIR:S,$${SRCTOP},$${OBJTOP},}
.if empty(MAKEOBJDIR)
# OBJTOP set below
MAKEOBJDIR=${_default_makeobjdir}
@ -25,9 +26,6 @@ MAKEOBJDIR=${_default_makeobjdir}
# now for our own use
MAKEOBJDIR= ${.CURDIR:S,${SRCTOP},${OBJTOP},}
.endif
.if ${MAKEOBJDIR:M*/*} == ""
.error Cannot use MAKEOBJDIR=${MAKEOBJDIR}${.newline}Unset MAKEOBJDIR to get default: MAKEOBJDIR='${_default_makeobjdir}'
.endif
.endif
.if !empty(SB)
SB_OBJROOT ?= ${SB}/obj/
@ -110,6 +108,12 @@ TARGET_SPEC = ${TARGET_SPEC_VARS:@v@${$v:U}@:ts,}
TARGET_OBJ_SPEC:= ${TARGET_SPEC:S;,;.;g}
OBJTOP:= ${OBJROOT}${TARGET_OBJ_SPEC}
.if defined(MAKEOBJDIR)
.if ${MAKEOBJDIR:M*/*} == ""
.error Cannot use MAKEOBJDIR=${MAKEOBJDIR}${.newline}Unset MAKEOBJDIR to get default: MAKEOBJDIR='${_default_makeobjdir}'
.endif
.endif
.if ${.CURDIR} == ${SRCTOP}
RELDIR = .
.elif ${.CURDIR:M${SRCTOP}/*}