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