Refactor (some more) installation of kernel and module objects.
Try to make everyone happy: David (to have debug kernels installed by default), Warner (to be able to override that), and myself (for actually making it all work and to be consistent). Now, if kernel was configured for debugging (through DEBUG=-g in the kernel config file or "config -g"), doing "make install" will install debug versions of kernel and module objects with their canonical names, kernel.debug -> /boot/kernel/kernel if_fxp.ko.debug -> /boot/kernel/if_fxp.ko Installing a kernel not configured for debugging, or debug kernel with INSTALL_NODEBUG variable defined, will install non-debug kernel and module objects. Also, restore the install.debug and reinstall.debug targets that are part of the existing API (they cause some additional gdb(1) scripts to be installed).
This commit is contained in:
parent
85155d23de
commit
d24864f785
@ -583,10 +583,6 @@ release.3:
|
||||
cd ${.CURDIR}/..; \
|
||||
${CROSSMAKE} ${KERNEL_FLAGS} \
|
||||
kernel \
|
||||
DESTDIR=${RD}/trees/base; \
|
||||
cd ${.CURDIR}/..; \
|
||||
${CROSSMAKE} ${KERNEL_FLAGS} -DNO_MODULES \
|
||||
reinstallkernel -DINSTALL_DEBUG \
|
||||
DESTDIR=${RD}/trees/base
|
||||
touch ${.TARGET}
|
||||
|
||||
|
@ -69,6 +69,8 @@ FULLKERNEL= ${KERNEL_KO}
|
||||
FULLKERNEL= ${KERNEL_KO}.debug
|
||||
${KERNEL_KO}: ${FULLKERNEL}
|
||||
${OBJCOPY} --strip-debug ${FULLKERNEL} ${KERNEL_KO}
|
||||
install.debug reinstall.debug: gdbinit
|
||||
cd ${.CURDIR}; ${MAKE} ${.TARGET:R}
|
||||
|
||||
# Install gdbinit files for kernel debugging.
|
||||
gdbinit:
|
||||
@ -204,7 +206,7 @@ kernel-install:
|
||||
.endif
|
||||
mkdir -p ${DESTDIR}${KODIR}
|
||||
.if defined(DEBUG) && !defined(INSTALL_NODEBUG)
|
||||
${INSTALL} -p -m 555 -o root -g wheel ${FULLKERNEL} ${DESTDIR}${KODIR}
|
||||
${INSTALL} -p -m 555 -o root -g wheel ${FULLKERNEL} ${DESTDIR}${KODIR}/${KERNEL_KO}
|
||||
.else
|
||||
${INSTALL} -p -m 555 -o root -g wheel ${KERNEL_KO} ${DESTDIR}${KODIR}
|
||||
.endif
|
||||
@ -212,7 +214,7 @@ kernel-install:
|
||||
kernel-reinstall:
|
||||
@-chflags -R noschg ${DESTDIR}${KODIR}
|
||||
.if defined(DEBUG) && !defined(INSTALL_NODEBUG)
|
||||
${INSTALL} -p -m 555 -o root -g wheel ${FULLKERNEL} ${DESTDIR}${KODIR}
|
||||
${INSTALL} -p -m 555 -o root -g wheel ${FULLKERNEL} ${DESTDIR}${KODIR}/${KERNEL_KO}
|
||||
.else
|
||||
${INSTALL} -p -m 555 -o root -g wheel ${KERNEL_KO} ${DESTDIR}${KODIR}
|
||||
.endif
|
||||
|
@ -236,21 +236,17 @@ _INSTALLFLAGS:= ${INSTALLFLAGS}
|
||||
_INSTALLFLAGS:= ${_INSTALLFLAGS${ie}}
|
||||
.endfor
|
||||
|
||||
.if !target(install.debug) && defined(DEBUG_FLAGS)
|
||||
install.debug:
|
||||
cd ${.CURDIR}; ${MAKE} -DINSTALL_DEBUG install
|
||||
.endif
|
||||
|
||||
.if !target(realinstall)
|
||||
realinstall: _kmodinstall
|
||||
.ORDER: beforeinstall _kmodinstall
|
||||
_kmodinstall:
|
||||
.if defined(DEBUG_FLAGS) && defined(INSTALL_DEBUG)
|
||||
.if defined(DEBUG_FLAGS) && !defined(INSTALL_NODEBUG)
|
||||
${INSTALL} -o ${KMODOWN} -g ${KMODGRP} -m ${KMODMODE} \
|
||||
${_INSTALLFLAGS} ${FULLPROG} ${DESTDIR}${KMODDIR}
|
||||
${_INSTALLFLAGS} ${FULLPROG} ${DESTDIR}${KMODDIR}/${PROG}
|
||||
.else
|
||||
${INSTALL} -o ${KMODOWN} -g ${KMODGRP} -m ${KMODMODE} \
|
||||
${_INSTALLFLAGS} ${PROG} ${DESTDIR}${KMODDIR}
|
||||
.endif
|
||||
|
||||
.include <bsd.links.mk>
|
||||
|
||||
@ -264,7 +260,6 @@ _kldxref:
|
||||
kldxref ${DESTDIR}${KMODDIR}; \
|
||||
fi
|
||||
.endif
|
||||
.endif
|
||||
.endif # !target(realinstall)
|
||||
|
||||
.endif # !target(install)
|
||||
|
Loading…
Reference in New Issue
Block a user