aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2019-11-21 18:14:26 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2019-11-21 18:14:26 +0000
commit9ab286b7c1ac1d8dd26ea957dfe5212e46ff6389 (patch)
tree25d7acb4acdbb54f8de3b345f37f99e3d5737e42
parentc4e11f2231112f846d050da9e92e7c807db83ef0 (diff)
downloadsrc-9ab286b7c1ac1d8dd26ea957dfe5212e46ff6389.tar.gz
src-9ab286b7c1ac1d8dd26ea957dfe5212e46ff6389.zip
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.
Notes
Notes: svn path=/head/; revision=354970
-rw-r--r--share/mk/kmod.opts.mk4
-rw-r--r--sys/conf/kmod.mk7
-rw-r--r--sys/conf/kmod.opts.mk16
3 files changed, 21 insertions, 6 deletions
diff --git a/share/mk/kmod.opts.mk b/share/mk/kmod.opts.mk
new file mode 100644
index 000000000000..172526adc2bb
--- /dev/null
+++ b/share/mk/kmod.opts.mk
@@ -0,0 +1,4 @@
+# $FreeBSD$
+
+.include <bsd.sysdir.mk>
+.include "${SYSDIR}/conf/kmod.opts.mk"
diff --git a/sys/conf/kmod.mk b/sys/conf/kmod.mk
index 73184acd5cb9..25db152aa001 100644
--- a/sys/conf/kmod.mk
+++ b/sys/conf/kmod.mk
@@ -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
diff --git a/sys/conf/kmod.opts.mk b/sys/conf/kmod.opts.mk
new file mode 100644
index 000000000000..cfb67400d050
--- /dev/null
+++ b/sys/conf/kmod.opts.mk
@@ -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>__)