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