- Clean up the bootloader Makefiles somewhat.

- Build an ECOFF version of the bootloader as "boot".  As a temporary
  measure (due to a bug in libbfd which has not yet been fixed, but
  for which a work-around exists as a patch), install and ELF version
  of the bootload as well as "boot.elf".  "boot.elf" will go away once
  the toolchain issue is resolved.
This commit is contained in:
thorpej 2001-11-22 00:58:07 +00:00
parent b5e0d97bf7
commit aabfa72384
2 changed files with 44 additions and 31 deletions

View File

@ -1,23 +1,22 @@
# $NetBSD: Makefile.booters,v 1.1 2001/11/21 19:09:06 thorpej Exp $
# $NetBSD: Makefile.booters,v 1.2 2001/11/22 00:58:07 thorpej Exp $
# $S must correspond to the top of the 'sys' tree
S= ${.CURDIR}/../../../..
.BEGIN: machine sgimips mips
${PROG} realdepend realall: machine sgimips mips
CLEANFILES+= machine sgimips mips
machine:
-rm -f ${.TARGET}
ln -s $S/arch/${MACHINE}/include ${.TARGET}
sgimips:
-rm -f ${.TARGET}
ln -s $S/arch/${MACHINE}/include ${.TARGET}
mips:
-rm -f ${.TARGET}
ln -s $S/arch/mips/include mips
BINMODE?= 444
.PHONY: machine-links
beforedepend: machine-links
# ${MACHINE} then ${MACHINE_ARCH}
machine-links:
-rm -f machine && \
ln -s $S/arch/${MACHINE}/include machine
-rm -f mips && \
ln -s $S/arch/mips/include mips
CLEANFILES+= machine mips
realall: machine-links ${PROG}
.PATH: ${.CURDIR}/../common
AFLAGS+= -D_LOCORE -D_KERNEL
# -I${.CURDIR}/../.. done by Makefile.inc
@ -32,9 +31,22 @@ CPPFLAGS+= -DNETBSD_VERS='"${NETBSD_VERS}"'
# PROG set by parent.
MKMAN= no
LOAD_ADDRESS?= 0x89000000
# We load the kernel at 512K in from the start of RAM to give the boot
# loader plenty of breathing room. Load the boot loader starting at
# the second page of RAM.
LOAD_ADDRESS?= 0x88002000
# if there is a 'version' file, add rule for vers.c and add it to SRCS
# and CLEANFILES
.if exists(version)
.PHONY: vers.c
vers.c: ${.CURDIR}/version
sh ${S}/conf/newvers_stand.sh -N ${.CURDIR}/version "sgimips"
SRCS+= vers.c
CLEANFILES+= vers.c
.endif
### find out what to use for libkern
KERN_AS= library
@ -56,21 +68,6 @@ LIBSA= ${SALIB}
LIBS= ${LIBSA} ${LIBZ} ${LIBSA} ${LIBKERN}
.PHONY: vers.c
vers.c: ${.CURDIR}/version
sh ${S}/conf/newvers_stand.sh -N ${.CURDIR}/version "sgimips"
${PROG}: machine mips sgimips ${OBJS} ${LIBS}
${LD} -Map ${PROG}.map -x -Ttext ${LOAD_ADDRESS} ${LDBUG} \
-e start -o ${PROG} ${OBJS} ${LIBS}
@${SIZE} ${PROG}
.if defined(CHECKSIZE_CMD)
@${CHECKSIZE_CMD} ${PROG} ${PRIMARY_MAX_LOAD} ${PRIMARY_MAX_TOTAL} || \
(rm -f ${PROG} ; false)
.endif
CLEANFILES+= ${PROG}.map
cleandir distclean: cleanlibdir
cleanlibdir:

View File

@ -1,7 +1,23 @@
# $NetBSD: Makefile,v 1.2 2001/11/21 23:33:17 thorpej Exp $
# $NetBSD: Makefile,v 1.3 2001/11/22 00:58:08 thorpej Exp $
PROG= boot
SRCS= start.S boot.c bootinfo.c conf.c devopen.c putchar.c getchar.c disk.c
${PROG}: ${PROG}.elf
${OBJCOPY} -O ecoff-bigmips ${PROG}.elf ${PROG}
@${SIZE} ${PROG}
# XXX Temporary hack to install the ELF verision, too.
FILES+= ${PROG}.elf
CLEANFILES+= ${PROG}.elf
CLEANFILES+= ${PROG}.map
.include "../Makefile.booters"
${PROG}.elf: ${OBJS} ${LIBS}
${LD} -Map ${PROG}.map -x -Ttext ${LOAD_ADDRESS} ${LDBUG} \
-e start -o ${PROG}.elf ${OBJS} ${LIBS}
@${STRIP} -s ${PROG}.elf
@${SIZE} ${PROG}.elf