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