1 # $NetBSD: Makefile,v 1.5 2008/02/23 06:51:28 tsutsui Exp $
5 SRCS
= start64.S boot.c bootinfo.c conf.c devopen.c putchar.c getchar.c \
10 .
include <bsd.sys.mk
> # for HOST_SH
12 # $S must correspond to the top of the 'sys' tree
13 S
= ${.CURDIR
}/..
/..
/..
/..
19 .PATH
: ${.CURDIR
}/..
/common
20 AFLAGS
+= -D_LOCORE
-D_KERNEL
-mno-abicalls
-mabi
=64 -D_LP64
21 CPPFLAGS
+= -nostdinc
-D_STANDALONE
-DNO_ABICALLS
-I
${.OBJDIR
} -I
${S}
22 # compiler flags for smallest code size
23 CFLAGS
= -ffreestanding
-Os
-Wall
-Werror
-mno-abicalls
-msoft-float
-G
1024 -mabi
=64 -D_LP64
24 LDBUG
= -T
$S/arch
/mips
/conf
/stand.ldscript
25 NETBSD_VERS
!= ${HOST_SH} ${.CURDIR
}/..
/..
/..
/..
/conf
/osrelease.sh
26 CPPFLAGS
+= -DNETBSD_VERS
='"${NETBSD_VERS}"'
33 # We load the kernel at 420K in from the start of RAM to give the boot
34 # loader plenty of breathing room. Load the boot loader starting at
35 # the second page of RAM.
37 LOAD_ADDRESS_IP30?
= 0xa800000020080000
39 # if there is a 'version' file, add rule for vers.c and add it to SRCS
43 vers.c
: ${.CURDIR
}/version
44 ${HOST_SH} ${S}/conf
/newvers_stand.sh
${.CURDIR
}/version
"sgimips"
50 ### find out what to use for libkern
52 KERNMISCMAKEFLAGS
+= LD
="${LD} -m elf64btsmip" RANLIB
="true"
53 .
include "${S}/lib/libkern/Makefile.inc"
56 ### find out what to use for libz
58 ZMISCMAKEFLAGS
+= LD
="${LD} -m elf64btsmip" RANLIB
="true"
59 .
include "${S}/lib/libz/Makefile.inc"
62 ### find out what to use for libsa
64 SAMISCMAKEFLAGS
+= SA_USE_LOADFILE
=yes SA_USE_CREAD
=yes \
65 LD
="${LD} -m elf64btsmip" RANLIB
="true"
66 .
include "${S}/lib/libsa/Makefile.inc"
70 LIBS
= ${LIBSA} ${LIBZ} ${LIBSA} ${LIBKERN}
72 ip30boot
: ${OBJS} ${LIBS}
73 ${LD} -m elf64btsmip
-Map boot.map
-x
-Ttext
${LOAD_ADDRESS_IP30} \
74 ${LDBUG} -e start
-o
${.TARGET
} ${OBJS} ${LIBS}
76 cleandir
distclean: cleanlibdir
80 .
include <bsd.klinks.mk
>
81 .
include <bsd.prog.mk
>