aboutsummaryrefslogtreecommitdiff
path: root/sys/conf/kmod.mk
diff options
context:
space:
mode:
authorBryan Drewery <bdrewery@FreeBSD.org>2018-03-28 16:28:24 +0000
committerBryan Drewery <bdrewery@FreeBSD.org>2018-03-28 16:28:24 +0000
commit7d9f50a4ba22fa733805a473866553021d79e659 (patch)
tree07be25a2925a14d1f8b6ebd457071ba9d52b74ad /sys/conf/kmod.mk
parentffae081b1ead4fd42cc3669a5fa3fc71e8bf8237 (diff)
downloadsrc-7d9f50a4ba22fa733805a473866553021d79e659.tar.gz
src-7d9f50a4ba22fa733805a473866553021d79e659.zip
Avoid looping if SYSDIR already known.
Sponsored by: Dell EMC
Notes
Notes: svn path=/head/; revision=331683
Diffstat (limited to 'sys/conf/kmod.mk')
-rw-r--r--sys/conf/kmod.mk4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/conf/kmod.mk b/sys/conf/kmod.mk
index 8503dd9163d9..d3a548c7e8d2 100644
--- a/sys/conf/kmod.mk
+++ b/sys/conf/kmod.mk
@@ -82,11 +82,13 @@ OBJCOPY?= objcopy
# Search for kernel source tree in standard places.
.if empty(KERNBUILDDIR)
+.if !defined(SYSDIR)
.for _dir in ${.CURDIR}/../.. ${.CURDIR}/../../.. /sys /usr/src/sys
-.if !defined(SYSDIR) && exists(${_dir}/kern/)
+.if exists(${_dir}/kern/)
SYSDIR= ${_dir:tA}
.endif
.endfor
+.endif
.if !defined(SYSDIR) || !exists(${SYSDIR}/kern/)
.error "can't find kernel source tree"
.endif