make option during kernel build to put object files in separate directory

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.
 
If I read this bit of /usr/src/Makefile correctly:
Code:
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.
 
Back
Top