diff --git a/sys/arch/sgimips/stand/Makefile.booters b/sys/arch/sgimips/stand/Makefile.booters index 7b2ba9e8afef..52b59b9b6ba5 100644 --- a/sys/arch/sgimips/stand/Makefile.booters +++ b/sys/arch/sgimips/stand/Makefile.booters @@ -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: diff --git a/sys/arch/sgimips/stand/boot/Makefile b/sys/arch/sgimips/stand/boot/Makefile index ef3d9eee492b..d6afbffc7923 100644 --- a/sys/arch/sgimips/stand/boot/Makefile +++ b/sys/arch/sgimips/stand/boot/Makefile @@ -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