summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2001-02-23 04:49:31 +0000
committerimp <imp@FreeBSD.org>2001-02-23 04:49:31 +0000
commit31a9c37539a5b0e6b4d12639f92a88b9f2a4fe96 (patch)
treef8f6b04dc54c4b53f9462a765a01686fd14dbe4e /sys
parent642141e5c9175709dced47e2b2d8910c757352a3 (diff)
downloadFreeBSD-src-31a9c37539a5b0e6b4d12639f92a88b9f2a4fe96.zip
FreeBSD-src-31a9c37539a5b0e6b4d12639f92a88b9f2a4fe96.tar.gz
If the symbolic links @ or machine exist, do not depend on them.
This fixes the problem where if src/sys or src/sys/$MACHINE_ARCH/include changed at all, all the modules would be rebuilt. Reviewed by: bde
Diffstat (limited to 'sys')
-rw-r--r--sys/conf/kmod.mk15
1 files changed, 12 insertions, 3 deletions
diff --git a/sys/conf/kmod.mk b/sys/conf/kmod.mk
index 4196bb6..f2b2833 100644
--- a/sys/conf/kmod.mk
+++ b/sys/conf/kmod.mk
@@ -158,10 +158,15 @@ _ILINKS=@ machine
.MAIN: all
all: objwarn ${PROG} all-man _SUBDIR
-beforedepend: ${_ILINKS}
+# Ensure that the links exist without depending on it when it exists which
+# causes all the modules to be rebuilt when the directory pointed to changes.
+.for _link in ${_ILINKS}
+.if !exists(${.OBJDIR}/${_link})
+${OBJS}: ${_link}
+beforedepend: ${_link}
@rm -f .depend
-
-${OBJS}: ${_ILINKS}
+.endif
+.endfor
# Search for kernel source tree in standard places.
.for _dir in ${.CURDIR}/../.. ${.CURDIR}/../../.. /sys /usr/src/sys
@@ -272,7 +277,9 @@ MFILES?= kern/bus_if.m kern/device_if.m dev/iicbus/iicbb_if.m \
.for _src in ${SRCS:M${_srcsrc:T:R}.${_ext}}
CLEANFILES+= ${_src}
.if !target(${_src})
+.if !exists(@)
${_src}: @
+.endif
.if exists(@)
${_src}: @/kern/makeobjops.pl @/${_srcsrc}
.endif
@@ -285,7 +292,9 @@ ${_src}: @/kern/makeobjops.pl @/${_srcsrc}
.for _ext in c h
.if ${SRCS:Mvnode_if.${_ext}} != ""
CLEANFILES+= vnode_if.${_ext}
+.if !exists(@)
vnode_if.${_ext}: @
+.endif
.if exists(@)
vnode_if.${_ext}: @/kern/vnode_if.pl @/kern/vnode_if.src
.endif
OpenPOWER on IntegriCloud