From 9ab286b7c1ac1d8dd26ea957dfe5212e46ff6389 Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Thu, 21 Nov 2019 18:14:26 +0000 Subject: [PATCH] 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. --- share/mk/kmod.opts.mk | 4 ++++ sys/conf/kmod.mk | 7 +------ sys/conf/kmod.opts.mk | 16 ++++++++++++++++ 3 files changed, 21 insertions(+), 6 deletions(-) create mode 100644 share/mk/kmod.opts.mk create mode 100644 sys/conf/kmod.opts.mk 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 +.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 -# 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 -.include "config.mk" +.include "kmod.opts.mk" .include .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(____) +____: + +.include +# 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 +.include "config.mk" + +.endif # !target(____)