diff options
author | peter <peter@FreeBSD.org> | 1999-04-13 18:25:08 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 1999-04-13 18:25:08 +0000 |
commit | b4de52ea84ee1c39c9aeff3e2d74dbd303c5c139 (patch) | |
tree | 304c4a2c2af9a64b9fef7d8a08425788e40e83cd /sys/i386/conf/Makefile.i386 | |
parent | 22b374184d4be9aa062ff5db81671078e660d88a (diff) | |
download | FreeBSD-src-b4de52ea84ee1c39c9aeff3e2d74dbd303c5c139.zip FreeBSD-src-b4de52ea84ee1c39c9aeff3e2d74dbd303c5c139.tar.gz |
Clean up the kernel/kernel.debug/install.debug etc stuff.
Sense ${DEBUG} to decide on building kernel.debug or not.
Use a common install and install.debug target to minimize duplication.
(I deleted the ELF transition kernel warning, it was getting dated..)
Diffstat (limited to 'sys/i386/conf/Makefile.i386')
-rw-r--r-- | sys/i386/conf/Makefile.i386 | 60 |
1 files changed, 21 insertions, 39 deletions
diff --git a/sys/i386/conf/Makefile.i386 b/sys/i386/conf/Makefile.i386 index aad7aba..d15c2bf 100644 --- a/sys/i386/conf/Makefile.i386 +++ b/sys/i386/conf/Makefile.i386 @@ -1,7 +1,7 @@ # Makefile.i386 -- with config changes. # Copyright 1990 W. Jolitz # from: @(#)Makefile.i386 7.1 5/10/91 -# $Id: Makefile.i386,v 1.142 1999/04/07 09:28:01 grog Exp $ +# $Id: Makefile.i386,v 1.143 1999/04/11 03:40:10 grog Exp $ # # Makefile for FreeBSD # @@ -17,7 +17,7 @@ # # Which version of config(8) is required. -%VERSREQ= 300010 +%VERSREQ= 300011 KERNFORMAT?= elf @@ -86,6 +86,7 @@ SYSTEM_DEP= Makefile symbols.exclude symbols.sort ${SYSTEM_OBJS} SYMORDER_EXCLUDE=-x symbols.exclude .endif SYSTEM_LD_HEAD= @echo loading ${.TARGET}; rm -f ${.TARGET} + .if ${KERNFORMAT} == aout || ${KERNFORMAT} == aoutkld SYSTEM_OBJS= locore.o vnode_if.o ${OBJS} ioconf.o param.o config.o SYSTEM_LD= @${LD} -aout -Bforcedynamic -Z -T ${LOAD_ADDRESS} -o ${.TARGET} -X ${SYSTEM_OBJS} vers.o @@ -93,6 +94,7 @@ SYSTEM_LD_TAIL= @echo rearranging symbols; \ symorder -m ${SYMORDER_EXCLUDE} symbols.sort ${.TARGET}; \ size -aout ${.TARGET} ; chmod 755 ${.TARGET} .endif + .if ${KERNFORMAT} == elf SYSTEM_OBJS= locore.o setdef0.o vnode_if.o ${OBJS} ioconf.o param.o config.o \ setdef1.o hack.So @@ -103,6 +105,12 @@ SYSTEM_LD_TAIL= @size -elf ${.TARGET} ; chmod 755 ${.TARGET} SYSTEM_DEP+= $S/i386/conf/kernel.script .endif +.if defined(DEBUG) +FULLKERNEL= ${KERNEL}.debug +.else +FULLKERNEL= ${KERNEL} +.endif + %BEFORE_DEPEND %OBJS @@ -205,47 +213,20 @@ tags: @echo "see $S/kern/Makefile for tags" .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 +${KERNEL}: ${FULLKERNEL} +.if ${KERNFORMAT} == "elf" + objcopy --strip-debug ${FULLKERNEL} ${KERNEL} +.else + cp ${FULLKERNEL} ${KERNEL} + strip -d kernel .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}/ - .endif -${INSTALL}: - @if [ ! -f ${KERNEL} ] ; then \ - echo "You must first build your kernel before trying to install." ; \ +install install.debug: + @if [ ! -f ${KERNEL}${.TARGET:S/install//} ] ; then \ + echo "You must first build a kernel first." ; \ exit 1 ; \ fi -.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 @@ -257,7 +238,8 @@ ${INSTALL}: mv -f /var/db/kvm_kernel.db /var/db/kvm_kernel.old.db ; \ fi \ fi - install -c -m 555 -o root -g wheel -fschg ${FULLKERNEL} ${DESTDIR}/${KERNEL} + install -c -m 555 -o root -g wheel -fschg \ + ${KERNEL}${.TARGET:S/install//} ${DESTDIR}/${KERNEL} config.o: ${NORMAL_C} |