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