From 6b1bb559587ebda7c3f441df965b57b91781fc43 Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Sun, 16 Nov 2003 01:41:38 +0000 Subject: [PATCH] Fix the building of null module. In the DIAGNOSTICS case, we include opt_ddb.h. These changes expand green's work of including opt_global.h to prefer opt files in the kernel directory. Further refinement might be needed, but I think this is good. Note: While this is a step on the path to moving the meta information about modules into the config files, it doesn't actually do that. It just pulls in the opt files in a way that allows one to build 'generic' modules outside the tree. --- sys/conf/kmod.mk | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sys/conf/kmod.mk b/sys/conf/kmod.mk index 7edbc821787..4854b2fbb0c 100644 --- a/sys/conf/kmod.mk +++ b/sys/conf/kmod.mk @@ -243,6 +243,17 @@ unload: ${KMODUNLOAD} -v ${KMOD} .endif +.if defined(KERNBUILDDIR) +.PATH: ${KERNBUILDDIR} +CFLAGS += -I${KERNBUILDDIR} +.for _src in ${SRCS:Mopt_*.h} +CLEANFILES+= ${_src} +.if !target(${_src}) +${_src}: + ln -s ${KERNBUILDDIR}/${_src} ${.TARGET} +.endif +.endfor +.else .for _src in ${SRCS:Mopt_*.h} CLEANFILES+= ${_src} .if !target(${_src}) @@ -250,6 +261,7 @@ ${_src}: touch ${.TARGET} .endif .endfor +.endif MFILES?= kern/bus_if.m kern/device_if.m dev/iicbus/iicbb_if.m \ dev/iicbus/iicbus_if.m isa/isa_if.m \