summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbdrewery <bdrewery@FreeBSD.org>2015-12-04 04:27:21 +0000
committerbdrewery <bdrewery@FreeBSD.org>2015-12-04 04:27:21 +0000
commit29f8ed25b545f44e5e4c9d5b3398ab2766eebf12 (patch)
treea197192858983873da54a455891a70eca70c5fcc
parent1a9ecd3df94c4288283e8beb306463d6464a4302 (diff)
downloadFreeBSD-src-29f8ed25b545f44e5e4c9d5b3398ab2766eebf12.zip
FreeBSD-src-29f8ed25b545f44e5e4c9d5b3398ab2766eebf12.tar.gz
Calculate MPATH for sys/modules to save 92% time in a basic 'obj' tree-walk.
Sponsored by: EMC / Isilon Storage Division
-rw-r--r--sys/conf/kmod.mk2
-rw-r--r--sys/modules/Makefile6
2 files changed, 8 insertions, 0 deletions
diff --git a/sys/conf/kmod.mk b/sys/conf/kmod.mk
index 50d21bd..203d6d7 100644
--- a/sys/conf/kmod.mk
+++ b/sys/conf/kmod.mk
@@ -370,8 +370,10 @@ vnode_if_typedef.h:
.endif
# Build _if.[ch] from _if.m, and clean them when we're done.
+# This is duplicated in sys/modules/Makefile.
.if !defined(__MPATH)
__MPATH!=find ${SYSDIR:tA}/ -name \*_if.m
+.export __MPATH
.endif
_MFILES=${__MPATH:T:O}
_MPATH=${__MPATH:H:O:u}
diff --git a/sys/modules/Makefile b/sys/modules/Makefile
index 0243166..85c3553 100644
--- a/sys/modules/Makefile
+++ b/sys/modules/Makefile
@@ -771,6 +771,12 @@ afterinstall:
.include "${SYSDIR}/conf/config.mk"
+# Use sys/conf/kmod.mk's MPATH to avoid redundantly running in every subdir.
+.if !defined(__MPATH)
+__MPATH!=find ${SYSDIR:tA}/ -name \*_if.m
+.export __MPATH
+.endif
+
SUBDIR:= ${SUBDIR:u:O}
.include <bsd.subdir.mk>
OpenPOWER on IntegriCloud