Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Where does the kernel get built?

Alan Barrett <> writes:

> On Tue, 29 Nov 2011, D'Arcy Cain wrote:
>>> set either MAKEOBJDIR or MAKEOBJDIRPREFIX in the environment
>>> [...]
>> Better yet, why can't we make it work from mk.conf?  It seems
>> like a wart that every option can be controlled there except
>> this one.
> .OBJDIR handling is one of the wartiest parts of make.  By the
> time mk.conf is parsed, make has already decided which .OBJDIR
> to use.

This is not the case, proof follows.

# Evidence 1.

# /tmp/
.if $(.OBJDIR) == $(.CURDIR)
.OBJDIR: /tmp
all:; echo $(.OBJDIR)

# checking:

lithium$ pwd
lithium$ make -f /tmp/ 
echo /tmp

# Evidence 2.

# /tmp/
GOT_IT= defined

# /tmp/
.if $(.OBJDIR) == $(.CURDIR)
.OBJDIR: /tmp
all:; @echo MAKECONF=$(MAKECONF); echo OBJDIR=$(.OBJDIR); echo GOT_IT=$(GOT_IT)

.include <>

# checking
lithium$ pwd
lithium$ make -f /tmp/ MAKECONF=/tmp/

You can call pwd(1) from "all" target and see that current directory is
exactly as defined by ".OBJDIR".


Home | Main Index | Thread Index | Old Index