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:
parent
4866e2769a
commit
f66116083c
@ -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
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user