> On Mar 11, 2017, at 18:27, Lawrence Stewart <lstew...@freebsd.org> wrote:
> 
> Hi Ian,

…

>> The MAKEOBJDIRPREFIX variable must be set in the environment, not in
>> make.conf or on the make command line (documented in build(7)).
> 
> Your assertion seems at odds with my past experience and my reading of
> the man page... from build(7):
> 
>       The build may be controlled by defining make(1) variables
>       described in the ENVIRONMENT section below, and by the
>       variables documented in make.conf(5).
> 
> ... which indicates they are make variables, not environment variables
> specifically. As a concrete example, TARGET and DESTDIR are listed under
> the "ENVIRONMENT" section of the man page, yet "EXAMPLES" shows:
> 
>           make TARGET=sparc64 buildworld
>           make TARGET=sparc64 DESTDIR=/clients/sparc64 installworld
> 
> I've certainly always set build vars documented in the "ENVIRONMENT"
> section of the man page on the make command line without issue. Pretty
> sure I've set MAKEOBJDIRPREFIX from the make command line also in the
> past, though perhaps it has been working for me "by accident" and a
> documentation tweak is in order if the distinction you make is in fact
> relevant...

Hi Lawrence,

Ian’s right per historical behavior, which should still be in effect today.

Unfortunately, setting MAKEOBJDIRPREFIX on the command line will result in bad 
things happening because of how bsd.obj.mk works and how MAKEOBJDIRPREFIX is 
manipulated in the build itself (see Makefile.libcompat — it affects some 
architectures, but maybe not sparc64). From …/Makefile (which should have 
triggered this error message to begin with):

171 MAKEOBJDIRPREFIX?=      /usr/obj
172 _MAKEOBJDIRPREFIX!= /usr/bin/env -i PATH=${PATH} MK_AUTO_OBJ=no ${MAKE} \
173     ${.MAKEFLAGS:MMAKEOBJDIRPREFIX=*} __MAKE_CONF=${__MAKE_CONF} \
174     -f /dev/null -V MAKEOBJDIRPREFIX dummy
175 .if !empty(_MAKEOBJDIRPREFIX)
176 .error MAKEOBJDIRPREFIX can only be set in environment, not as a global\
177         (in make.conf(5)) or command-line variable.
178 .endif

Are you sure your script/process didn’t catch a relevant build error?

Cheers,
-Ngie

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

Reply via email to