Home | History | Annotate | Line # | Download | only in mk
bsd.kernobj.mk revision 1.7
      1  1.7  jmc #	$NetBSD: bsd.kernobj.mk,v 1.7 2001/11/27 05:39:03 jmc Exp $
      2  1.1  sjg 
      3  1.4  sjg # KERNSRCDIR	Is the location of the top of the kernel src.
      4  1.4  sjg # 		It defaults to ${BSDSRCDIR}/sys, but the top-level
      5  1.4  sjg # 		Makefile.inc sets it to ${ABSTOP}/sys (ABSTOP is the
      6  1.4  sjg # 		absolute path to the directory where the top-level
      7  1.4  sjg # 		Makefile.inc was found.
      8  1.4  sjg # 
      9  1.4  sjg # KERNARCHDIR	Is the location of the machine dependent kernel
     10  1.4  sjg # 		sources.  It defaults to arch/${MACHINE}
     11  1.4  sjg # 		
     12  1.4  sjg # KERNCONFDIR	Is where the configuration files for kernels are
     13  1.4  sjg # 		found; default is ${KERNSRCDIR}/${KERNARCHDIR}/conf.
     14  1.4  sjg # 
     15  1.4  sjg # KERNOBJDIR	Is the kernel build directory.  The kernel GENERIC for
     16  1.4  sjg # 		instance will be compiled in ${KERNOBJDIR}/GENERIC.
     17  1.4  sjg # 		The default value is
     18  1.7  jmc # 		${KERNSRCDIR}/${KERNARCHDIR}/compile
     19  1.7  jmc #
     20  1.7  jmc #		If MAKEOBJDIRPREFIX or _SRC_TOP_OBJ is set than the value will
     21  1.7  jmc #		be either 
     22  1.7  jmc #
     23  1.7  jmc #		${MAKEOBJDIRPREFIX}${KERNSRCDIR}/${KERNARCHDIR}/compile
     24  1.7  jmc #
     25  1.7  jmc #		or
     26  1.7  jmc #
     27  1.7  jmc #		${_SRC_TOP_OBJ_}/sys/${KERNARCHDIR}/compile
     28  1.7  jmc #
     29  1.7  jmc #		with MAKEOBJDIRPREFIX taking priority over _SRC_TOP_OBJ_ 
     30  1.4  sjg # 
     31  1.1  sjg 
     32  1.7  jmc .include <bsd.own.mk>
     33  1.7  jmc 
     34  1.1  sjg KERNSRCDIR?=	${BSDSRCDIR}/sys
     35  1.1  sjg # just incase ${MACHINE} is not always correct
     36  1.1  sjg KERNARCHDIR?=	arch/${MACHINE}
     37  1.1  sjg 
     38  1.7  jmc #
     39  1.7  jmc # XXX It's ugly but it does what we need here. If making objects use the above
     40  1.7  jmc # rules for trying to figure out a KERNOBJDIR.
     41  1.7  jmc #
     42  1.7  jmc # When coming back through here in rules (such as building kernels for
     43  1.7  jmc # a release), check which vars we're using and which directory base has been
     44  1.7  jmc # made in the previous obj stage to figure out which one to expose.
     45  1.7  jmc #
     46  1.7  jmc # All cases will fall through to the ${KERNSRCDIR}/${KERNARCHDIR}/compile case
     47  1.7  jmc # if nothing ends up setting this.
     48  1.7  jmc .if make(obj) || \
     49  1.7  jmc     (defined(MAKEOBJDIRPREFIX) && exists(${MAKEOBJDIRPREFIX}${KERNSRCDIR}/${KERNARCHDIR}/compile)) || \
     50  1.7  jmc     (defined(_SRC_TOP_OBJ_) && exists(${_SRC_TOP_OBJ_}/sys/${KERNARCHDIR}/compile))
     51  1.7  jmc .if defined (MAKEOBJDIRPREFIX)
     52  1.7  jmc KERNOBJDIR?=    ${MAKEOBJDIRPREFIX}${KERNSRCDIR}/${KERNARCHDIR}/compile
     53  1.1  sjg .else
     54  1.7  jmc .if defined(_SRC_TOP_OBJ_) && ${_SRC_TOP_OBJ_} != ""
     55  1.7  jmc KERNOBJDIR?=	${_SRC_TOP_OBJ_}/sys/${KERNARCHDIR}/compile
     56  1.7  jmc .endif
     57  1.7  jmc .endif
     58  1.7  jmc .endif
     59  1.7  jmc 
     60  1.1  sjg KERNOBJDIR?=	${KERNSRCDIR}/${KERNARCHDIR}/compile
     61  1.7  jmc 
     62  1.1  sjg KERNCONFDIR?=	${KERNSRCDIR}/${KERNARCHDIR}/conf
     63