diff --git a/share/mk/bsd.dtb.mk b/share/mk/bsd.dtb.mk index 6a0e78a3c66d..718c41dab4fa 100644 --- a/share/mk/bsd.dtb.mk +++ b/share/mk/bsd.dtb.mk @@ -3,7 +3,8 @@ # Search for kernel source tree in standard places. .if empty(KERNBUILDDIR) .if !defined(SYSDIR) -.for _dir in ${.CURDIR}/../.. ${.CURDIR}/../../.. ${.CURDIR}/../../../.. \ +.for _dir in ${SRCTOP:D${SRCTOP}/sys} \ + ${.CURDIR}/../.. ${.CURDIR}/../../.. ${.CURDIR}/../../../.. \ ${.CURDIR}/../../../../.. /sys /usr/src/sys .if !defined(SYSDIR) && exists(${_dir}/kern/) && exists(${_dir}/conf/kmod.mk) SYSDIR= ${_dir} diff --git a/share/mk/bsd.kmod.mk b/share/mk/bsd.kmod.mk index f754254b21bb..d790165623c3 100644 --- a/share/mk/bsd.kmod.mk +++ b/share/mk/bsd.kmod.mk @@ -3,7 +3,8 @@ # Search for kernel source tree in standard places. .if empty(KERNBUILDDIR) .if !defined(SYSDIR) -.for _dir in ${.CURDIR}/../.. ${.CURDIR}/../../.. ${.CURDIR}/../../../.. \ +.for _dir in ${SRCTOP:D${SRCTOP}/sys} \ + ${.CURDIR}/../.. ${.CURDIR}/../../.. ${.CURDIR}/../../../.. \ ${.CURDIR}/../../../../.. /sys /usr/src/sys .if !defined(SYSDIR) && exists(${_dir}/kern/) && exists(${_dir}/conf/kmod.mk) SYSDIR= ${_dir:tA} diff --git a/sys/conf/kmod.mk b/sys/conf/kmod.mk index 258686f18fd5..e1d6d69549a4 100644 --- a/sys/conf/kmod.mk +++ b/sys/conf/kmod.mk @@ -83,7 +83,8 @@ OBJCOPY?= objcopy # Search for kernel source tree in standard places. .if empty(KERNBUILDDIR) .if !defined(SYSDIR) -.for _dir in ${.CURDIR}/../.. ${.CURDIR}/../../.. /sys /usr/src/sys +.for _dir in ${SRCTOP:D${SRCTOP}/sys} \ + ${.CURDIR}/../.. ${.CURDIR}/../../.. /sys /usr/src/sys .if !defined(SYSDIR) && exists(${_dir}/kern/) SYSDIR= ${_dir:tA} .endif