Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/sparc/stand Build several versions of the second-st...



details:   https://anonhg.NetBSD.org/src/rev/3edc70ffd3da
branches:  trunk
changeset: 482766:3edc70ffd3da
user:      pk <pk%NetBSD.org@localhost>
date:      Mon Feb 21 14:41:22 2000 +0000

description:
Build several versions of the second-stage boot program, each linked
to run at a different base address. Boot image build procedures can
pick one which is least likely to fail..

The default boot program is again build to run at 0x340000.

diffstat:

 sys/arch/sparc/stand/Makefile.buildboot |  12 ++-----
 sys/arch/sparc/stand/boot/Makefile      |  50 +++++++++++++++++++++-----------
 2 files changed, 37 insertions(+), 25 deletions(-)

diffs (104 lines):

diff -r b5297a706865 -r 3edc70ffd3da sys/arch/sparc/stand/Makefile.buildboot
--- a/sys/arch/sparc/stand/Makefile.buildboot   Mon Feb 21 13:46:02 2000 +0000
+++ b/sys/arch/sparc/stand/Makefile.buildboot   Mon Feb 21 14:41:22 2000 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile.buildboot,v 1.9 2000/01/23 17:04:10 mycroft Exp $
+#      $NetBSD: Makefile.buildboot,v 1.10 2000/02/21 14:41:22 pk Exp $
 
 S=     ${.CURDIR}/../../../..
 
@@ -10,15 +10,11 @@
 MKMAN=         no
 BINMODE=       444
 
-RELOC_SUN4=    0x240000
-RELOC_SUN4C=   0x340000
-RELOC_SUN4M=   0x440000
-
+RELOCS=                240000 340000 440000 700000
 # Note: a `RELOC' value of 0x340000 seems to work on most machines
-RELOC?=                ${RELOC_SUN4C}
+RELOC_DEFAULT?=        340000
 
-CPPFLAGS+=     -D_STANDALONE -DRELOC=${RELOC} -DSUN4 -DSUN4C -DSUN_BOOTPARAMS\
-               -DHEAP_VARIABLE
+CPPFLAGS+=     -D_STANDALONE -DSUN4 -DSUN4C -DSUN_BOOTPARAMS -DHEAP_VARIABLE
 
 CPPFLAGS+=     -I. -I${.CURDIR}/../../.. -I${.CURDIR}/../../../..
 CFLAGS=                -O2
diff -r b5297a706865 -r 3edc70ffd3da sys/arch/sparc/stand/boot/Makefile
--- a/sys/arch/sparc/stand/boot/Makefile        Mon Feb 21 13:46:02 2000 +0000
+++ b/sys/arch/sparc/stand/boot/Makefile        Mon Feb 21 14:41:22 2000 +0000
@@ -1,39 +1,55 @@
-#      $NetBSD: Makefile,v 1.16 1999/11/09 18:39:41 mycroft Exp $
+#      $NetBSD: Makefile,v 1.17 2000/02/21 14:41:24 pk Exp $
 
 STRIPFLAG=
-PROG=          boot
-PROGSOURCE=    boot.c net.c netif_sun.c conf.c openfirm.c bootinfo.c
-FILES=         boot.net
+PROGSOURCE=    boot.c net.c netif_sun.c conf.c openfirm.c bootinfo.c vers.c
 NEWVERSWHAT=   "Secondary Boot"
-CLEANFILES+=   vers.c vers.o boot.net
+FILES=         boot.net ${RELOCS:S/^/boot./g}
+CLEANFILES:=   vers.c ${FILES}
+LINKS=         ${BINDIR}/boot.${RELOC_DEFAULT} ${BINDIR}/boot
 
 INCLUDE_LIBZ=  yes
 SAMISCMAKEFLAGS= SA_USE_CREAD=yes
 
 .include "../Makefile.buildboot"
 
-RELOC=         0x700000
+.if exists(${.CURDIR}/../Makefile.inc)
+.include "${.CURDIR}/../Makefile.inc"
+.endif
+.include <bsd.own.mk>
 
-.include <bsd.own.mk>
+OBJS=${SRCS:N*.h:N*.sh:N*.fth:R:S/$/.o/g}
 
 OBJCOPY?=      objcopy
 
-LINKFLAGS=-N -Ttext ${RELOC} -e start
+LINKFLAGS=-N -e start
 
+.MAIN: all
 all: ${FILES}
 
-${PROG}: ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN}
+
+vers.c:
        sh ${.CURDIR}/../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT}
-       ${COMPILE.c} vers.c
-       ${LD} -o ${.TARGET}.tmp ${LINKFLAGS} ${OBJS} \
-           vers.o ${LIBSA} ${LIBZ} ${LIBKERN}
-       @${SIZE} ${.TARGET}.tmp
-       @${OBJCOPY} -O binary ${.TARGET}.tmp ${.TARGET}
-       @rm -f ${.TARGET}.tmp
+
+.for RELOC in ${RELOCS}
+boot.${RELOC}: ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN}
+       ${LD} -o ${.TARGET}.tmp ${LINKFLAGS} -Ttext ${RELOC} ${OBJS} \
+           ${LIBSA} ${LIBZ} ${LIBKERN}
+       ${SIZE} ${.TARGET}.tmp
+       ${OBJCOPY} -O binary ${.TARGET}.tmp ${.TARGET}
+       rm -f ${.TARGET}.tmp
+.endfor
  
+
 # conjure up a magic header that is accepted by all Sun PROMS;
 # see installboot.c for details.
-${FILES}: ${PROG}
+boot.net: boot.${RELOC_DEFAULT}
        (printf '\01\03\01\07\060\200\0\07\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0'; cat ${.ALLSRC} ) > ${.TARGET}
 
-.include <bsd.prog.mk>
+clean cleandir: cleanprog
+
+cleanprog:
+       rm -f ${OBJS} ${CLEANFILES}
+
+.include <bsd.files.mk>
+.include <bsd.links.mk>
+.include <bsd.sys.mk>



Home | Main Index | Thread Index | Old Index