1 1.1.2.5 skrll # $NetBSD: Makefile,v 1.1.2.5 2005/01/17 19:30:19 skrll Exp $ 2 1.1.2.2 skrll 3 1.1.2.2 skrll PROG= ip30boot 4 1.1.2.2 skrll 5 1.1.2.2 skrll SRCS= start64.S boot.c bootinfo.c conf.c devopen.c putchar.c getchar.c \ 6 1.1.2.2 skrll getopt.c disk.c 7 1.1.2.2 skrll 8 1.1.2.2 skrll CLEANFILES+= boot.map 9 1.1.2.2 skrll 10 1.1.2.2 skrll .include <bsd.sys.mk> # for HOST_SH 11 1.1.2.2 skrll 12 1.1.2.2 skrll # $S must correspond to the top of the 'sys' tree 13 1.1.2.2 skrll S= ${.CURDIR}/../../../.. 14 1.1.2.2 skrll 15 1.1.2.2 skrll BINMODE?= 444 16 1.1.2.2 skrll 17 1.1.2.2 skrll realall: ${PROG} 18 1.1.2.2 skrll 19 1.1.2.2 skrll .PATH: ${.CURDIR}/../common 20 1.1.2.2 skrll AFLAGS+= -D_LOCORE -D_KERNEL -mno-abicalls -mabi=64 -D_LP64 21 1.1.2.2 skrll CPPFLAGS+= -nostdinc -D_STANDALONE -DNO_ABICALLS -I${.OBJDIR} -I${S} 22 1.1.2.2 skrll # compiler flags for smallest code size 23 1.1.2.2 skrll CFLAGS= -ffreestanding -Os -Wall -Werror -mno-abicalls -msoft-float -G 1024 -mabi=64 -D_LP64 24 1.1.2.2 skrll LDBUG= -T $S/arch/mips/conf/stand.ldscript 25 1.1.2.2 skrll NETBSD_VERS!= ${HOST_SH} ${.CURDIR}/../../../../conf/osrelease.sh 26 1.1.2.2 skrll CPPFLAGS+= -DNETBSD_VERS='"${NETBSD_VERS}"' 27 1.1.2.2 skrll 28 1.1.2.2 skrll CPPFLAGS+= -Dsgimips 29 1.1.2.2 skrll 30 1.1.2.2 skrll # PROG set by parent. 31 1.1.2.2 skrll NOMAN= # defined 32 1.1.2.2 skrll 33 1.1.2.2 skrll # We load the kernel at 420K in from the start of RAM to give the boot 34 1.1.2.2 skrll # loader plenty of breathing room. Load the boot loader starting at 35 1.1.2.2 skrll # the second page of RAM. 36 1.1.2.2 skrll 37 1.1.2.2 skrll LOAD_ADDRESS_IP30?= 0xa800000020080000 38 1.1.2.2 skrll 39 1.1.2.2 skrll # if there is a 'version' file, add rule for vers.c and add it to SRCS 40 1.1.2.2 skrll # and CLEANFILES 41 1.1.2.2 skrll .if exists(version) 42 1.1.2.2 skrll .PHONY: vers.c 43 1.1.2.2 skrll vers.c: ${.CURDIR}/version 44 1.1.2.2 skrll ${HOST_SH} ${S}/conf/newvers_stand.sh -N ${.CURDIR}/version "sgimips" 45 1.1.2.2 skrll 46 1.1.2.2 skrll SRCS+= vers.c 47 1.1.2.2 skrll CLEANFILES+= vers.c 48 1.1.2.2 skrll .endif 49 1.1.2.2 skrll 50 1.1.2.2 skrll ### find out what to use for libkern 51 1.1.2.2 skrll KERN_AS= library 52 1.1.2.5 skrll KERNMISCMAKEFLAGS+= LD="${LD} -m elf64btsmip" RANLIB="true" 53 1.1.2.2 skrll .include "${S}/lib/libkern/Makefile.inc" 54 1.1.2.2 skrll LIBKERN= ${KERNLIB} 55 1.1.2.2 skrll 56 1.1.2.2 skrll ### find out what to use for libz 57 1.1.2.2 skrll Z_AS= library 58 1.1.2.5 skrll ZMISCMAKEFLAGS+= LD="${LD} -m elf64btsmip" RANLIB="true" 59 1.1.2.2 skrll .include "${S}/lib/libz/Makefile.inc" 60 1.1.2.2 skrll LIBZ= ${ZLIB} 61 1.1.2.2 skrll 62 1.1.2.2 skrll ### find out what to use for libsa 63 1.1.2.2 skrll SA_AS= library 64 1.1.2.2 skrll SAMISCMAKEFLAGS+= SA_USE_LOADFILE=yes SA_USE_CREAD=yes \ 65 1.1.2.5 skrll LD="${LD} -m elf64btsmip" RANLIB="true" 66 1.1.2.2 skrll .include "${S}/lib/libsa/Makefile.inc" 67 1.1.2.2 skrll LIBSA= ${SALIB} 68 1.1.2.2 skrll 69 1.1.2.2 skrll .if !make(obj) && !make(clean) && !make(cleandir) 70 1.1.2.2 skrll .BEGIN: 71 1.1.2.2 skrll @([ -h machine ] || ln -s ${S}/arch/${MACHINE}/include machine) 72 1.1.2.2 skrll @([ -h mips ] || ln -s ${S}/arch/mips/include mips) 73 1.1.2.2 skrll .NOPATH: machine mips 74 1.1.2.2 skrll .endif 75 1.1.2.2 skrll CLEANFILES+= machine mips 76 1.1.2.2 skrll 77 1.1.2.2 skrll 78 1.1.2.2 skrll LIBS= ${LIBSA} ${LIBZ} ${LIBSA} ${LIBKERN} 79 1.1.2.2 skrll 80 1.1.2.2 skrll ip30boot: ${OBJS} ${LIBS} 81 1.1.2.5 skrll ${LD} -m elf64btsmip -Map boot.map -x -Ttext ${LOAD_ADDRESS_IP30} \ 82 1.1.2.2 skrll ${LDBUG} -e start -o ip30boot ${OBJS} ${LIBS} 83 1.1.2.2 skrll 84 1.1.2.2 skrll .include <bsd.prog.mk> 85