xref: /netbsd-src/sys/arch/sgimips/stand/Makefile.booters (revision d02e022db788ed4933c5904d9d6ce3af08f11fee)
1# $NetBSD: Makefile.booters,v 1.25 2019/01/12 16:44:47 tsutsui Exp $
2
3# PROG set by parent.
4NOMAN=		# defined
5NOPIE=		# defined
6
7.include <bsd.init.mk>
8.include <bsd.sys.mk>		# for HOST_SH
9
10# $S must correspond to the top of the 'sys' tree
11S=	${.CURDIR}/../../../..
12
13BINMODE?=	444
14
15# XXX SHOULD NOT NEED TO DEFINE THESE!
16LIBCRT0=
17LIBCRTI=
18LIBC=
19LIBCRTBEGIN=
20LIBCRTEND=
21
22realall: ${PROG}
23
24.PATH:		${.CURDIR}/../common
25.if !defined(PRE_ARCS)
26.PATH.S:	${S}/dev/arcbios
27.endif
28AFLAGS+=	-D_LOCORE -D_KERNEL -mno-abicalls
29CPPFLAGS+=	-nostdinc -D_STANDALONE -DNO_ABICALLS -I${.OBJDIR} -I${S}
30# compiler flags for smallest code size
31CFLAGS=		-ffreestanding -Os -Wall -Werror -mno-abicalls -msoft-float -G 1024
32.if ${MACHINE_ARCH} == "mips64eb"
33AFLAGS+=	-mips3 -mabi=32
34CFLAGS+=	-mips3 -mabi=32
35.endif
36CWARNFLAGS+=	-Wall -Werror
37CWARNFLAGS+=	-Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith
38CWARNFLAGS+=	-Wno-pointer-sign
39LDBUG=		-T $S/arch/mips/conf/stand.ldscript
40NETBSD_VERS!=	${HOST_SH} ${.CURDIR}/../../../../conf/osrelease.sh
41CPPFLAGS+=	-DNETBSD_VERS='"${NETBSD_VERS}"'
42
43CPPFLAGS+=	-Dsgimips
44
45.if !defined(PRE_ARCS)
46.include "${S}/dev/arcbios/Makefile.inc"
47.endif
48
49# We load the kernel at 420K in from the start of RAM to give the boot
50# loader plenty of breathing room.  Load the boot loader starting at
51# the second page of RAM.
52# A warm thank-you to SGI for making load addresses different :)
53LOAD_ADDRESS?=		0x88002000
54LOAD_ADDRESS_IP12?=	0x80368000
55LOAD_ADDRESS_IP32?=	0x80002000
56
57.include "${S}/conf/newvers_stand.mk"
58
59### find out what to use for libkern
60KERN_AS=	library
61.include "${S}/lib/libkern/Makefile.inc"
62LIBKERN=	${KERNLIB}
63
64### find out what to use for libz
65Z_AS=		library
66.include "${S}/lib/libz/Makefile.inc"
67LIBZ=		${ZLIB}
68
69### find out what to use for libsa
70SA_AS=		library
71SAMISCMAKEFLAGS+=SA_USE_LOADFILE=yes SA_USE_CREAD=yes
72# for now:
73SAMISCMAKEFLAGS+=SA_INCLUDE_NET=no
74.include "${S}/lib/libsa/Makefile.inc"
75LIBSA=		${SALIB}
76
77
78LIBS=		${LIBSA} ${LIBZ} ${LIBSA} ${LIBKERN}
79
80.include <bsd.klinks.mk>
81.include <bsd.prog.mk>
82