Cache _MPATH and pass it down into the modules build. Some NFS setups

make the find it does extremely expensive, so compute it only
once. Also make sure the 'traditional' module building method works at
the expense of a bit of duplicated code.
This commit is contained in:
Warner Losh 2015-07-04 05:43:45 +00:00
parent 3e307100f6
commit 8cad626fbb
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=285124
2 changed files with 9 additions and 0 deletions

View File

@ -198,6 +198,12 @@ SYSTEM_LD_TAIL= @${OBJCOPY} --strip-symbol gcc2_compiled. ${.TARGET} ; \
${SIZE} ${.TARGET} ; chmod 755 ${.TARGET}
SYSTEM_DEP+= ${LDSCRIPT}
# Calculate path for .m files early, if needed.
.if !defined(_MPATH)
__MPATH!=find ${S:tA}/ -name \*_if.m
_MPATH=${__MPATH:H:O:u}
.endif
# MKMODULESENV is set here so that port makefiles can augment
# them.
@ -214,6 +220,7 @@ MKMODULESENV+= MODULES_OVERRIDE="${MODULES_OVERRIDE}"
.if defined(DEBUG)
MKMODULESENV+= DEBUG_FLAGS="${DEBUG}"
.endif
MKMODULESENV+= _MPATH="${_MPATH}"
# Detect kernel config options that force stack frames to be turned on.
DDB_ENABLED!= grep DDB opt_ddb.h || true ; echo

View File

@ -355,8 +355,10 @@ vnode_if_typedef.h:
.endif
# Build _if.[ch] from _if.m, and clean them when we're done.
.if !defined(_MPATH)
__MPATH!=find ${SYSDIR:tA}/ -name \*_if.m
_MPATH=${__MPATH:H:O:u}
.endif
.PATH.m: ${_MPATH}
.for _s in ${SRCS:M*_if.[ch]}
.if eixsts(${_s:R}.m})