mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-06 09:10:28 +00:00
Makefile: Fix MAKEOBJDIRPREFIX command-line variable check for bmake
Unlike the old fmake, running make FOO=bar when using bmake doesn't put FOO=bar in .MAKEFLAGS at the top level, it instead just puts FOO in .MAKEOVERRIDES and the full MAKEFLAGS will be formed for sub-makes. Moreover, this only applies for sub-makes in rules, so this doesn't apply to those in shell assignments. This means that the current check does not catch make MAKEOBJDIRPREFIX=..., only those defined in config files. Thus we must also check .MAKEOVERRIDES explicitly. Reviewed by: sjg MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31015
This commit is contained in:
parent
ade2ea3c45
commit
d0c737e184
2
Makefile
2
Makefile
|
@ -218,7 +218,7 @@ _MAKEOBJDIRPREFIX!= /usr/bin/env -i PATH=${PATH} ${MAKE} MK_AUTO_OBJ=no \
|
||||||
${.MAKEFLAGS:MMAKEOBJDIRPREFIX=*} __MAKE_CONF=${__MAKE_CONF} \
|
${.MAKEFLAGS:MMAKEOBJDIRPREFIX=*} __MAKE_CONF=${__MAKE_CONF} \
|
||||||
SRCCONF=${SRCCONF} SRC_ENV_CONF= \
|
SRCCONF=${SRCCONF} SRC_ENV_CONF= \
|
||||||
-f /dev/null -V MAKEOBJDIRPREFIX dummy
|
-f /dev/null -V MAKEOBJDIRPREFIX dummy
|
||||||
.if !empty(_MAKEOBJDIRPREFIX)
|
.if !empty(_MAKEOBJDIRPREFIX) || !empty(.MAKEOVERRIDES:MMAKEOBJDIRPREFIX)
|
||||||
.error MAKEOBJDIRPREFIX can only be set in environment or src-env.conf(5),\
|
.error MAKEOBJDIRPREFIX can only be set in environment or src-env.conf(5),\
|
||||||
not as a global (in make.conf(5) or src.conf(5)) or command-line variable.
|
not as a global (in make.conf(5) or src.conf(5)) or command-line variable.
|
||||||
.endif
|
.endif
|
||||||
|
|
Loading…
Reference in a new issue