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