When building a debugging kernel with modules, build modules with

debugging support as well.  Debugging module support is handled
identically to kernel debugging support, right down to poor
choice of make variable names.
This commit is contained in:
Sheldon Hearn 2001-08-02 09:22:18 +00:00
parent 4866e2769a
commit f66116083c
2 changed files with 14 additions and 2 deletions

View File

@ -272,6 +272,9 @@ MKMODULESENV= MAKEOBJDIRPREFIX=${.OBJDIR}/modules KMODDIR=${KODIR}
.if defined(MODULES_OVERRIDE)
MKMODULESENV+= MODULES_OVERRIDE="${MODULES_OVERRIDE}"
.endif
.if defined(DEBUG)
MKMODULESENV+= DEBUG="${DEBUG}" DEBUG_FLAGS="${DEBUG}"
.endif
modules:
@mkdir -p ${.OBJDIR}/modules

View File

@ -77,6 +77,7 @@
KMODLOAD?= /sbin/kldload
KMODUNLOAD?= /sbin/kldunload
OBJCOPY?= objcopy
TARGET_ARCH?= ${MACHINE_ARCH}
@ -131,7 +132,15 @@ OBJS+= ${SRCS:N*.h:R:S/$/.o/g}
PROG= ${KMOD}.ko
.endif
${PROG}: ${KMOD}.kld
.if !defined(DEBUG)
FULLPROG= ${PROG}
.else
FULLPROG= ${PROG}.debug
${PROG}: ${FULLPROG}
${OBJCOPY} --strip-debug ${FULLPROG} ${PROG}
.endif
${FULLPROG}: ${KMOD}.kld
${LD} -Bshareable ${LDFLAGS} -o ${.TARGET} ${KMOD}.kld
${KMOD}.kld: ${OBJS}
@ -188,7 +197,7 @@ ${_ILINKS}:
${ECHO} ${.TARGET} "->" $$path ; \
ln -s $$path ${.TARGET}
CLEANFILES+= ${PROG} ${KMOD}.kld ${OBJS} ${_ILINKS} symb.tmp tmp.o
CLEANFILES+= ${PROG} ${FULLPROG} ${KMOD}.kld ${OBJS} ${_ILINKS} symb.tmp tmp.o
.if !target(install)
.if !target(beforeinstall)