diff options
author | grog <grog@FreeBSD.org> | 1999-04-07 09:28:03 +0000 |
---|---|---|
committer | grog <grog@FreeBSD.org> | 1999-04-07 09:28:03 +0000 |
commit | 23a589f45ba719ddb3d051d5c71098c19b10c4df (patch) | |
tree | 89b714bfc94b5697e0e0889c16dbdba2b16e229b /sys/pc98 | |
parent | 68437b1a0e8b58742a74cd819278c2cd5f520bb3 (diff) | |
download | FreeBSD-src-23a589f45ba719ddb3d051d5c71098c19b10c4df.zip FreeBSD-src-23a589f45ba719ddb3d051d5c71098c19b10c4df.tar.gz |
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.
Diffstat (limited to 'sys/pc98')
-rw-r--r-- | sys/pc98/conf/Makefile.pc98 | 56 |
1 files changed, 43 insertions, 13 deletions
diff --git a/sys/pc98/conf/Makefile.pc98 b/sys/pc98/conf/Makefile.pc98 index d427328..a90547d 100644 --- a/sys/pc98/conf/Makefile.pc98 +++ b/sys/pc98/conf/Makefile.pc98 @@ -3,7 +3,7 @@ # Makefile.i386 -- with config changes. # Copyright 1990 W. Jolitz # from: @(#)Makefile.i386 7.1 5/10/91 -# $Id: Makefile.pc98,v 1.56 1999/03/02 14:01:33 kato Exp $ +# $Id: Makefile.pc98,v 1.57 1999/03/13 13:18:00 kato Exp $ # # Makefile for FreeBSD # @@ -19,7 +19,7 @@ # # Which version of config(8) is required. -%VERSREQ= 300009 +%VERSREQ= 300010 KERNFORMAT?= elf @@ -126,8 +126,8 @@ ${SYSTEM_OBJS}: vnode_if.h ${BEFORE_DEPEND:M*.h} clean: rm -f *.o *.so *.So *.ko *.s eddep errs genassym gensetdefs \ - kernel linterrs makelinks param.c setdef[01].c setdefs.h \ - symbols.exclude symbols.sort tags \ + ${KERNEL} ${FULLKERNEL} linterrs makelinks param.c \ + setdef[01].c setdefs.h symbols.exclude symbols.sort tags \ vers.c vnode_if.c vnode_if.h ${CLEAN} #lint: /tmp param.c @@ -208,13 +208,43 @@ links: tags: @echo "see $S/kern/Makefile for tags" -install: - @if [ ! -f kernel ] ; then \ +.if defined(DEBUG) +install: ${KERNEL} +.if ${KERNFORMAT} == "elf" && !defined(FORCE) + @if [ -f /${KERNEL} -a "`file /${KERNEL} 2>/dev/null | grep ELF`" = "" ]; then \ + echo "WARNING: You are about to install an ELF kernel for the first time!" ; \ + echo "Please be sure you have upgraded your bootblocks and/or /boot/loader so" ; \ + echo "that you can boot it. Old bootblocks WILL NOT WORK! Please read:" ; \ + echo "http://www.freebsd.org/~peter/elfday.html for information." ; \ + echo "If you are satisfied you can boot an ELF kernel, type: make -DFORCE install" ; \ + exit 1 ; \ + fi +.endif +.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 ${KERNFORMAT} == "elf" && !defined(FORCE) - @if [ -f /kernel -a "`file /kernel 2>/dev/null | grep ELF`" = "" ]; then \ + @if [ -f /${KERNEL} -a "`file /${KERNEL} 2>/dev/null | grep ELF`" = "" ]; then \ echo "WARNING: You are about to install an ELF kernel for the first time!" ; \ echo "Please be sure you have upgraded your bootblocks and/or /boot/loader so" ; \ echo "that you can boot it. Old bootblocks WILL NOT WORK! Please read:" ; \ @@ -223,18 +253,18 @@ install: exit 1 ; \ fi .endif -.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} config.o: ${NORMAL_C} |