World broken in stage 1.1

Ruslan Ermilov ru at
Wed Aug 11 02:33:18 PDT 2004

On Wed, Aug 11, 2004 at 11:12:53AM +0200, Thomas Nystrom wrote:
> Ruslan Ermilov wrote:
> > 
> > Trying to set MAKEOBJDIRPREFIX in /etc/make.conf and attempting to buildworld
> > RELENG_4 on a 4.x machine similarly fails right away.
> > 
> > The reason I'm writing this email is that I'm really interested in
> > reproducing the case where it could have possible worked before.  Any help
> > on your side would be highly appreciated.
> > 
> > The only case that I know of this could have worked (tested) is if make(1)
> > was instructed to prefer the MAKEOBJDIRPREFIX environment variable over a
> > global one, with ``make -E MAKEOBJDIRPREFIX''.  Then setting MAKEOBJDIRPREFIX
> > in /etc/make.conf works.
> I have been using 'MAKEOBJDIRPREFIX?= /home/obj' (or similair) in
> /etc/make.conf for quite a long time now. NOTE: it must be '?='. I have
> used it on both 4.x and 5.x (latest 5.2.1-R).
Yes, setting MAKEOBJDIRPREFIX?= in /etc/make.conf will work for
"make buildworld", BUT FOR BUILDWORLD ONLY, because Makefile.inc1
will reset MAKEOBJDIRPREFIX in environment (as expected by make(1))
for all buildworld substages, correcting the user's mistake.  In
other words, it happens to magically work for a buildworld (and
other world-related targets).

OTOH, a plain "make" somewhere with MAKEOBJDIRPREFIX set both in
environment (where make(1) expects to find it) and in /etc/make.conf
will break.  Compare:


# rm -rf /home/ru/obj
# pwd
# env MAKEOBJDIRPREFIX=/home/ru/obj make -f whereobj
# env MAKEOBJDIRPREFIX=/home/ru/obj make -f obj
/home/ru/obj/tmp/x created for /tmp/x
# env MAKEOBJDIRPREFIX=/home/ru/obj make -f whereobj


# rm -rf /home/ru/obj
# grep MAKEOBJDIRPREFIX /etc/make.conf 
MAKEOBJDIRPREFIX?=      /home/ru/obj
# make -f whereobj
# make -f obj
/home/ru/obj/tmp/x created for /tmp/x
# make -f whereobj

The "whereobj" target just prints the idea of the make(1)'s
object directory (where object files get created, also the
current working directory before make(1) starts to produce

MAKEOBJDIRPREFIX in /etc/make.conf, in any form, is a strict
"no no"!  Fix it now, or you will get a ton of troubles some

Ruslan Ermilov
ru at
FreeBSD committer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url :

More information about the freebsd-current mailing list