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