Is cross-world building broken?

Simon J. Gerraty sjg at juniper.net
Fri Nov 30 17:47:20 UTC 2012


On Fri, 30 Nov 2012 08:15:03 -0700, Ian Lepore writes:
>So when did this break, and why can't it be fixed?  I've been using

Sorry I missed the begining of this thread,
is anything broken?

>Also, how about "make DESTDIR=foo buildkernel installkernel" which is
>something I've been doing for years, you're saying that now that won't
>work because DESTDIR will be there during the build part?

It will be set - but that doesn't mean it would have any effect/impact.

Oh and contrary to what I told Adrian earlier, buildworld's manipulation
of DESTDIR would generally be unaffected, because the makefiles do not
actually attempt to set it (vs simply passing a new value to a submake).

An demo might help.

In the following
BINDIR is affected by a value set in either environment or on
commandline
LIBDIR is only affected by a value set on commandline
The DESTDIR seen by install run by child is unaffected by anything, even
though the values for LIBDIR and BINDIR are.


--------------------8<--------------------
BINDIR?= /bin
LIBDIR= /lib

all: install child 

install:
	@echo DESTDIR=${DESTDIR}
	@echo install stuff to ${DESTDIR}${BINDIR}
	@echo install stuff to ${DESTDIR}${LIBDIR}

child:
	${MAKE} -f ${MAKEFILE} DESTDIR=/tmp/childest install


demo:	 all envset cmdset


envset:
	BINDIR=/sbin LIBDIR=/usr/lib DESTDIR=$@ ${MAKE} -f ${MAKEFILE} 

cmdset:
	${MAKE} -f ${MAKEFILE} BINDIR=/sbin LIBDIR=/usr/lib DESTDIR=$@
--------------------8<--------------------

$ make -r -f /homes/sjg/make-tests/destdir demo 
DESTDIR=
install stuff to /bin
install stuff to /lib
make -f /homes/sjg/make-tests/destdir DESTDIR=/tmp/childest install
DESTDIR=/tmp/childest
install stuff to /tmp/childest/bin
install stuff to /tmp/childest/lib
BINDIR=/sbin LIBDIR=/usr/lib DESTDIR=envset make -f
/homes/sjg/make-tests/destdir
DESTDIR=envset
install stuff to envset/sbin
install stuff to envset/lib
make -f /homes/sjg/make-tests/destdir DESTDIR=/tmp/childest install
DESTDIR=/tmp/childest
install stuff to /tmp/childest/sbin
install stuff to /tmp/childest/lib
make -f /homes/sjg/make-tests/destdir BINDIR=/sbin LIBDIR=/usr/lib
DESTDIR=cmdset
DESTDIR=cmdset
install stuff to cmdset/sbin
install stuff to cmdset/usr/lib
make -f /homes/sjg/make-tests/destdir DESTDIR=/tmp/childest install
DESTDIR=/tmp/childest
install stuff to /tmp/childest/sbin
install stuff to /tmp/childest/lib
$


More information about the freebsd-current mailing list