NetBSD/share/mk/bsd.kernobj.mk
lukem 4bb41ae2f2 Rework how KERNOBJDIR functions; now it's always determined with
cd ${KERNSRCDIR}/${KERNARCHDIR}/compile && ${PRINTOBJDIR}
This is far simpler than the previous system, and more robust with
objdirs built via BSDOBJDIR.

The previous method of finding KERNOBJDIR when using BSDOBJDIR by
referencing _SRC_TOP_OBJ_ from another directory was extremely
fragile due to the depth first tree walk by <bsd.subdir.mk>, and
the caching of _SRC_TOP_OBJ_ (with MAKEOVERRIDES) which would be
empty on the *first* pass to create fresh objdirs.

This change requires adding sys/arch/*/compile/Makefile to create
the objdir in that directory, and descending into arch/*/compile
from arch/*/Makefile.  Remove the now-unnecessary .keep_me files
whilst here.

Per lengthy discussion with Andrew Brown.
2003-01-06 17:40:18 +00:00

27 lines
913 B
Makefile

# $NetBSD: bsd.kernobj.mk,v 1.10 2003/01/06 17:40:19 lukem Exp $
# KERNSRCDIR Is the location of the top of the kernel src.
# It defaults to `${NETBSDSRCDIR}/sys'.
#
# KERNARCHDIR Is the location of the machine dependent kernel sources.
# It defaults to `arch/${MACHINE}', but may be overridden
# in case ${MACHINE} is not correct.
#
# KERNCONFDIR Is where the configuration files for kernels are found.
# It defaults to `${KERNSRCDIR}/${KERNARCHDIR}/conf'.
#
# KERNOBJDIR Is the kernel build directory. The kernel GENERIC for
# instance will be compiled in ${KERNOBJDIR}/GENERIC.
# The default is the .OBJDIR of
# `${KERNSRCDIR}/${KERNARCHDIR}/compile'.
#
.include <bsd.own.mk>
KERNSRCDIR?= ${NETBSDSRCDIR}/sys
KERNARCHDIR?= arch/${MACHINE}
KERNCONFDIR?= ${KERNSRCDIR}/${KERNARCHDIR}/conf
.if !defined(KERNOBJDIR)
KERNOBJDIR!= cd ${KERNSRCDIR}/${KERNARCHDIR}/compile && ${PRINTOBJDIR}
.endif