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