From 2005b07aa88ae556f7268c6c6cbe5513c01d28d7 Mon Sep 17 00:00:00 2001 From: Greg Lehey Date: Wed, 7 Apr 1999 09:28:03 +0000 Subject: 1. Modify config to issue different code for debugging. 2. Config complains if you use -g: Debugging is enabled by default, there is no ned to specify the -g option 3. Config warns you if you don't use -s: Building kernel with full debugging symbols. Do "config -s BSD" for historic partial symbolic support. To install the debugging kernel, do make install.debug (BSD was the name of the config file I used; I print out the same name). 4. Modify Makefile.i386, Makefile.alpha, Makefile.pc98 and config to work if a kernel name other than 'kernel' is specified. This is not absolutely necessary, but useful, and it was relatively easy. I now have a kernel called /crapshit :-) 5. Modify Makefile.i386, Makefile.alpha, Makefile.pc98 "clean" target to remove both the debug and normal kernel. 6. Modify all to install the stripped kernel by default and the debug kernel if you enter "make install.debug". 7. Update version number of Makefiles and config. --- sys/alpha/conf/Makefile.alpha | 46 +++++++++++++++++++++++++++++++------------ 1 file changed, 33 insertions(+), 13 deletions(-) (limited to 'sys/alpha') diff --git a/sys/alpha/conf/Makefile.alpha b/sys/alpha/conf/Makefile.alpha index e2ccd567c7cd..0253ae344292 100644 --- a/sys/alpha/conf/Makefile.alpha +++ b/sys/alpha/conf/Makefile.alpha @@ -1,7 +1,7 @@ # Makefile.alpha -- with config changes. # Copyright 1990 W. Jolitz # from: @(#)Makefile.alpha 7.1 5/10/91 -# $Id: Makefile.alpha,v 1.17 1999/02/02 18:34:23 dfr Exp $ +# $Id: Makefile.alpha,v 1.18 1999/02/14 13:56:15 des Exp $ # # Makefile for FreeBSD # @@ -17,7 +17,7 @@ # # Which version of config(8) is required. -%VERSREQ= 300009 +%VERSREQ= 300010 BINFORMAT?= elf @@ -103,9 +103,9 @@ ${SYSTEM_OBJS}: ${BEFORE_DEPEND:M*.h} .endif clean: - rm -f *.o *.s eddep errs genassym gensetdefs kernel linterrs \ - makelinks param.c setdefs.h symbols.exclude symbols.sort tags \ - vers.c vnode_if.c vnode_if.h ${CLEAN} + rm -f *.o *.s eddep errs genassym gensetdefs ${KERNEL} ${FULLKERNEL} \ + linterrs makelinks param.c setdefs.h symbols.exclude \ + symbols.sort tags vers.c vnode_if.c vnode_if.h ${CLEAN} #lint: /tmp param.c # @lint -hbxn -DGENERIC -Dvolatile= ${COPTS} ${PARAM} \ @@ -245,23 +245,43 @@ links: tags: @echo "see $S/kern/Makefile for tags" -install: - @if [ ! -f kernel ] ; then \ +.if defined(DEBUG) +install: ${KERNEL} +.if exists(${DESTDIR}/${KERNEL}) + -chflags noschg ${DESTDIR}/${KERNEL} + mv ${DESTDIR}/${KERNEL} ${DESTDIR}/${KERNEL}.old +.endif + PATH=$${PATH}:/sbin:/usr/sbin; \ + if [ `sysctl -n kern.bootfile` = ${DESTDIR}/${KERNEL} ] ; then \ + sysctl -w kern.bootfile=${DESTDIR}/${KERNEL}.old ; \ + if [ -f /var/db/kvm_kernel.db ] ; then \ + mv -f /var/db/kvm_kernel.db /var/db/kvm_kernel.old.db ; \ + fi \ + fi + install -c -m 555 -o root -g wheel -fschg ${KERNEL} ${DESTDIR}/ + +${KERNEL}: ${KERNEL}.debug + objcopy --strip-debug ${KERNEL}.debug ${KERNEL} + +.endif + +${INSTALL}: + @if [ ! -f ${FULLKERNEL} ] ; then \ echo "You must first build your kernel before trying to install." ; \ exit 1 ; \ fi -.if exists(${DESTDIR}/kernel) - -chflags noschg ${DESTDIR}/kernel - mv ${DESTDIR}/kernel ${DESTDIR}/kernel.old +.if exists(${DESTDIR}/${KERNEL}) + -chflags noschg ${DESTDIR}/${KERNEL} + mv ${DESTDIR}/${KERNEL} ${DESTDIR}/${KERNEL}.old .endif PATH=$${PATH}:/sbin:/usr/sbin; \ - if [ `sysctl -n kern.bootfile` = ${DESTDIR}/kernel ] ; then \ - sysctl -w kern.bootfile=${DESTDIR}/kernel.old ; \ + if [ `sysctl -n kern.bootfile` = ${DESTDIR}/${KERNEL} ] ; then \ + sysctl -w kern.bootfile=${DESTDIR}/${KERNEL}.old ; \ if [ -f /var/db/kvm_kernel.db ] ; then \ mv -f /var/db/kvm_kernel.db /var/db/kvm_kernel.old.db ; \ fi \ fi - install -c -m 555 -o root -g wheel -fschg kernel ${DESTDIR}/ + install -c -m 555 -o root -g wheel -fschg ${FULLKERNEL} ${DESTDIR}/${KERNEL} ioconf.o: ioconf.c $S/sys/param.h $S/sys/buf.h ${CC} -c ${CFLAGS} ioconf.c -- cgit v1.3