xref: /freebsd/share/mk/bsd.sysdir.mk (revision 7ef62cebc2f965b0f640263e179276928885e33d)
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