xref: /freebsd/share/mk/bsd.sysdir.mk (revision aa1a8ff2d6dbc51ef058f46f3db5a8bb77967145)
1
2.-include <local.sysdir.mk>
3
4# Search for kernel source tree in standard places.
5.if !defined(SYSDIR)
6.for _dir in ${SRCTOP:D${SRCTOP}/sys} \
7    ${.CURDIR}/../.. ${.CURDIR}/../../.. ${.CURDIR}/../../../.. \
8    ${.CURDIR}/../../../../.. /sys /usr/src/sys
9.if !defined(SYSDIR) && exists(${_dir}/kern/) && exists(${_dir}/conf/kmod.mk)
10SYSDIR=	${_dir:tA}
11.endif
12.endfor
13.endif
14.if !defined(SYSDIR) || !exists(${SYSDIR}/kern/) || \
15    !exists(${SYSDIR}/conf/kmod.mk)
16.error Unable to locate the kernel source tree. Set SYSDIR to override.
17.endif
18