aboutsummaryrefslogtreecommitdiff
path: root/sys/conf/kmod.mk
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2015-12-01 21:19:16 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2015-12-01 21:19:16 +0000
commit2cd2ff0e26a605554cd8c273839c73c505ea0f12 (patch)
treedb504215e4f4319049d9ce11848d34ea6b37fa2c /sys/conf/kmod.mk
parent945ceaafbc93c05d6f622eaa5cb025c64b3425f1 (diff)
downloadsrc-2cd2ff0e26a605554cd8c273839c73c505ea0f12.tar.gz
src-2cd2ff0e26a605554cd8c273839c73c505ea0f12.zip
Restore cleaning of auto-generated kobj files after the recent MFILES
changes. Use the list of MFILES found by find to identify the set of possible auto-generated files and add the intersection of this set and SRCS to CLEANFILES. Submitted by: imp (previous version), sbruno Differential Revision: https://reviews.freebsd.org/D4336
Notes
Notes: svn path=/head/; revision=291614
Diffstat (limited to 'sys/conf/kmod.mk')
-rw-r--r--sys/conf/kmod.mk12
1 files changed, 8 insertions, 4 deletions
diff --git a/sys/conf/kmod.mk b/sys/conf/kmod.mk
index 8bbcfcb767d0..50d21bd3ec6d 100644
--- a/sys/conf/kmod.mk
+++ b/sys/conf/kmod.mk
@@ -370,14 +370,18 @@ vnode_if_typedef.h:
.endif
# Build _if.[ch] from _if.m, and clean them when we're done.
-.if !defined(_MPATH)
+.if !defined(__MPATH)
__MPATH!=find ${SYSDIR:tA}/ -name \*_if.m
-_MPATH=${__MPATH:H:O:u}
.endif
+_MFILES=${__MPATH:T:O}
+_MPATH=${__MPATH:H:O:u}
.PATH.m: ${_MPATH}
.for _i in ${SRCS:M*_if.[ch]}
-#removes too much, comment out until it's more constrained.
-#CLEANFILES+= ${_i}
+_MATCH=M${_i:R:S/$/.m/}
+_MATCHES=${_MFILES:${_MATCH}}
+.if !empty(_MATCHES)
+CLEANFILES+= ${_i}
+.endif
.endfor # _i
.m.c: ${SYSDIR}/tools/makeobjops.awk
${AWK} -f ${SYSDIR}/tools/makeobjops.awk ${.IMPSRC} -c