PDA

View Full Version : make option during kernel build to put object files in separate directory


bsd_newbie
March 4th, 2009, 19:29
What is the option to make to have it put .o files in a user specified directory.

So instead of just saying make buildkernel KERNCONF=MYKERNEL,

I would like to add an extra option to specify a path where object files should be put, rather than the default path.

thanks.

SirDice
March 4th, 2009, 19:38
If I read this bit of /usr/src/Makefile correctly:

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


You'll need to set the MAKEOBJDIRPREFIX environment variable.