Avoid upwards directory walk in kernel build for finding known SYSDIR.

Sponsored by:	Dell EMC
This commit is contained in:
Bryan Drewery 2018-03-28 16:28:20 +00:00
parent dbb4ba297b
commit ffae081b1e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=331682
3 changed files with 6 additions and 0 deletions

View File

@ -1,6 +1,7 @@
# $FreeBSD$
# Search for kernel source tree in standard places.
.if empty(KERNBUILDDIR)
.for _dir in ${.CURDIR}/../.. ${.CURDIR}/../../.. ${.CURDIR}/../../../.. \
${.CURDIR}/../../../../.. /sys /usr/src/sys
.if !defined(SYSDIR) && exists(${_dir}/kern/) && exists(${_dir}/conf/kmod.mk)
@ -11,6 +12,7 @@ SYSDIR= ${_dir}
!exists(${SYSDIR}/conf/kmod.mk)
.error Unable to locate the kernel source tree. Set SYSDIR to override.
.endif
.endif
.include "${SYSDIR}/conf/dtb.mk"

View File

@ -1,6 +1,7 @@
# $FreeBSD$
# Search for kernel source tree in standard places.
.if empty(KERNBUILDDIR)
.for _dir in ${.CURDIR}/../.. ${.CURDIR}/../../.. ${.CURDIR}/../../../.. \
${.CURDIR}/../../../../.. /sys /usr/src/sys
.if !defined(SYSDIR) && exists(${_dir}/kern/) && exists(${_dir}/conf/kmod.mk)
@ -11,5 +12,6 @@ SYSDIR= ${_dir:tA}
!exists(${SYSDIR}/conf/kmod.mk)
.error Unable to locate the kernel source tree. Set SYSDIR to override.
.endif
.endif
.include "${SYSDIR}/conf/kmod.mk"

View File

@ -81,6 +81,7 @@ OBJCOPY?= objcopy
.include "config.mk"
# Search for kernel source tree in standard places.
.if empty(KERNBUILDDIR)
.for _dir in ${.CURDIR}/../.. ${.CURDIR}/../../.. /sys /usr/src/sys
.if !defined(SYSDIR) && exists(${_dir}/kern/)
SYSDIR= ${_dir:tA}
@ -89,6 +90,7 @@ SYSDIR= ${_dir:tA}
.if !defined(SYSDIR) || !exists(${SYSDIR}/kern/)
.error "can't find kernel source tree"
.endif
.endif
.SUFFIXES: .out .o .c .cc .cxx .C .y .l .s .S .m