1276846Simp# $FreeBSD$
2276846Simp
3276846Simp# Search for kernel source tree in standard places.
4276846Simp.for _dir in ${.CURDIR}/../.. ${.CURDIR}/../../.. ${.CURDIR}/../../../.. \
5276846Simp    ${.CURDIR}/../../../../.. /sys /usr/src/sys
6276846Simp.if !defined(SYSDIR) && exists(${_dir}/kern/) && exists(${_dir}/conf/kmod.mk)
7276846SimpSYSDIR=	${_dir}
8276846Simp.endif
9276846Simp.endfor
10276846Simp.if !defined(SYSDIR) || !exists(${SYSDIR}/kern/) || \
11276846Simp    !exists(${SYSDIR}/conf/kmod.mk)
12276846Simp.error Unable to locate the kernel source tree. Set SYSDIR to override.
13276846Simp.endif
14276846Simp
15276846Simp.include "${SYSDIR}/conf/dtb.mk"
16276846Simp
17276846Simp.include <bsd.sys.mk>
18