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