Add a kmod.opts.mk.

This Makefile sets KERN_OPTS.  This permits kernel module Makefiles to
use KERN_OPTS to control the value of variables such as SRCS that are
used by bsd.kmod.mk for KERN_OPTS values that honor WITH/WITHOUT
options for standalone builds.
This commit is contained in:
jhb 2019-11-21 18:14:26 +00:00
parent 76b6cb8234
commit a735104ede
3 changed files with 21 additions and 6 deletions

4
share/mk/kmod.opts.mk Normal file
View File

@ -0,0 +1,4 @@
# $FreeBSD$
.include <bsd.sysdir.mk>
.include "${SYSDIR}/conf/kmod.opts.mk"

View File

@ -73,12 +73,7 @@ KMODUNLOAD?= /sbin/kldunload
KMODISLOADED?= /sbin/kldstat -q -n
OBJCOPY?= objcopy
.include <bsd.init.mk>
# Grab all the options for a kernel build. For backwards compat, we need to
# do this after bsd.own.mk.
.include "kern.opts.mk"
.include <bsd.compiler.mk>
.include "config.mk"
.include "kmod.opts.mk"
.include <bsd.sysdir.mk>
.SUFFIXES: .out .o .c .cc .cxx .C .y .l .s .S .m

16
sys/conf/kmod.opts.mk Normal file
View File

@ -0,0 +1,16 @@
# $FreeBSD$
#
# Handle options (KERN_OPTS) for kernel module options. This can be included earlier in a kmod Makefile
# to allow KERN_OPTS to control SRCS, etc.
.if !target(__<kmod.opts.mk>__)
__<kmod.opts.mk>__:
.include <bsd.init.mk>
# Grab all the options for a kernel build. For backwards compat, we need to
# do this after bsd.own.mk.
.include "kern.opts.mk"
.include <bsd.compiler.mk>
.include "config.mk"
.endif # !target(__<kmod.opts.mk>__)