xref: /netbsd/share/mk/bsd.kernobj.mk (revision 74226c78)
1#	$NetBSD: bsd.kernobj.mk,v 1.14 2013/06/03 07:39:07 mrg 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 sources.
7#		It defaults to `arch/${MACHINE}', but may be overridden
8#		in case ${MACHINE} is not correct.
9#
10# KERNCONFDIRDEFAULT	Is the default for ${KERNCONFDIR}.
11#		It defaults to `${KERNSRCDIR}/${KERNARCHDIR}/conf'.
12#
13# KERNCONFDIR	Is where the configuration files for kernels are found.
14#		Users can set this to have build.sh find kernel
15#		configurations in another directory.
16#		It defaults to `${KERNCONFDIRDEFAULT}'.
17#
18# KERNOBJDIR	Is the kernel build directory.  The kernel GENERIC for
19# 		instance will be compiled in ${KERNOBJDIR}/GENERIC.
20# 		The default is the .OBJDIR of
21#		`${KERNSRCDIR}/${KERNARCHDIR}/compile'.
22#
23
24.include <bsd.own.mk>
25
26KERNSRCDIR?=		${NETBSDSRCDIR}/sys
27KERNARCHDIR?=		arch/${MACHINE}
28KERNCONFDIRDEFAULT?=	${KERNSRCDIR}/${KERNARCHDIR}/conf
29KERNCONFDIR?=		${KERNCONFDIRDEFAULT}
30
31.if !defined(KERNOBJDIR) && exists(${KERNSRCDIR}/${KERNARCHDIR}/compile)
32KERNOBJDIR!=	cd "${KERNSRCDIR}/${KERNARCHDIR}/compile" && ${PRINTOBJDIR}
33.endif
34