diff --git a/sys/modules/Makefile b/sys/modules/Makefile index 0a2c32f7f03c..5afaf5610719 100644 --- a/sys/modules/Makefile +++ b/sys/modules/Makefile @@ -460,6 +460,10 @@ _sound= sound SUBDIR=${MODULES_OVERRIDE} .endif +.for reject in ${WITHOUT_MODULES} +SUBDIR:= ${SUBDIR:N${reject}} +.endfor + # Calling kldxref(8) for each module is expensive. .if !defined(NO_XREF) .MAKEFLAGS+= -DNO_XREF