For HEAD, install a kernel with debug information if DEBUG is a kernel

config option.  It is too easy to loose the build directory and not have
symbols for kgdb to read.
This commit is contained in:
David E. O'Brien 2005-09-11 00:22:21 +00:00
parent 2a5bd389cf
commit e319790c0c

View File

@ -63,12 +63,7 @@ modules-all modules-depend: modules-obj
.endif
.endif
.if !defined(DEBUG)
FULLKERNEL= ${KERNEL_KO}
.else
FULLKERNEL= ${KERNEL_KO}.debug
${KERNEL_KO}: ${FULLKERNEL}
${OBJCOPY} --strip-debug ${FULLKERNEL} ${KERNEL_KO}
.if defined(DEBUG)
install.debug reinstall.debug: gdbinit
cd ${.CURDIR}; ${MAKE} -DINSTALL_DEBUG ${.TARGET:R}
@ -83,7 +78,7 @@ gdbinit:
.endif
.endif
${FULLKERNEL}: ${SYSTEM_DEP} vers.o
${KERNEL_KO}: ${SYSTEM_DEP} vers.o
@rm -f ${.TARGET}
@echo linking ${.TARGET}
${SYSTEM_LD}
@ -109,7 +104,7 @@ ${mfile:T:S/.m$/.h/}: ${mfile}
kernel-clean:
rm -f *.o *.so *.So *.ko *.s eddep errs \
${FULLKERNEL} ${KERNEL_KO} linterrs makelinks tags vers.c \
${KERNEL_KO} linterrs makelinks tags vers.c \
vnode_if.c vnode_if.h vnode_if_newproto.h vnode_if_typedef.h \
${MFILES:T:S/.m$/.c/} ${MFILES:T:S/.m$/.h/} \
${CLEAN}
@ -186,7 +181,7 @@ kernel-install: kernel-install-check
.endif
kernel-install:
@if [ ! -f ${FULLKERNEL} ] ; then \
@if [ ! -f ${KERNEL_KO} ] ; then \
echo "You must build a kernel first." ; \
exit 1 ; \
fi
@ -205,19 +200,11 @@ kernel-install:
fi
.endif
mkdir -p ${DESTDIR}${KODIR}
.if defined(DEBUG) && defined(INSTALL_DEBUG)
${INSTALL} -p -m 555 -o root -g wheel ${FULLKERNEL} ${DESTDIR}${KODIR}
.else
${INSTALL} -p -m 555 -o root -g wheel ${KERNEL_KO} ${DESTDIR}${KODIR}
.endif
kernel-reinstall:
@-chflags -R noschg ${DESTDIR}${KODIR}
.if defined(DEBUG) && defined(INSTALL_DEBUG)
${INSTALL} -p -m 555 -o root -g wheel ${FULLKERNEL} ${DESTDIR}${KODIR}
.else
${INSTALL} -p -m 555 -o root -g wheel ${KERNEL_KO} ${DESTDIR}${KODIR}
.endif
config.o env.o hints.o vers.o vnode_if.o:
${NORMAL_C}