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