xref: /netbsd-src/sys/arch/sgimips/stand/Makefile.booters (revision 8b0f9554ff8762542c4defc4f70e1eb76fb508fa)
1# $NetBSD: Makefile.booters,v 1.13 2005/12/11 12:18:58 christos 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
23LDBUG=		-T $S/arch/mips/conf/stand.ldscript
24NETBSD_VERS!=	${HOST_SH} ${.CURDIR}/../../../../conf/osrelease.sh
25CPPFLAGS+=	-DNETBSD_VERS='"${NETBSD_VERS}"'
26
27CPPFLAGS+=	-Dsgimips
28
29# PROG set by parent.
30NOMAN=		# defined
31
32# We load the kernel at 420K in from the start of RAM to give the boot
33# loader plenty of breathing room.  Load the boot loader starting at
34# the second page of RAM.
35# A warm thank-you to SGI for making load addresses different :)
36LOAD_ADDRESS?=		0x88002000
37LOAD_ADDRESS_IP32?=	0x80002000
38
39# if there is a 'version' file, add rule for vers.c and add it to SRCS
40# and CLEANFILES
41.if exists(version)
42.PHONY: vers.c
43vers.c: ${.CURDIR}/version
44	${HOST_SH} ${S}/conf/newvers_stand.sh -N ${.CURDIR}/version "sgimips"
45
46SRCS+=	vers.c
47CLEANFILES+= vers.c
48.endif
49
50### find out what to use for libkern
51KERN_AS=	library
52.include "${S}/lib/libkern/Makefile.inc"
53LIBKERN=	${KERNLIB}
54
55### find out what to use for libz
56Z_AS=		library
57.include "${S}/lib/libz/Makefile.inc"
58LIBZ=		${ZLIB}
59
60### find out what to use for libsa
61SA_AS=		library
62SAMISCMAKEFLAGS+=SA_USE_LOADFILE=yes SA_USE_CREAD=yes
63# for now:
64SAMISCMAKEFLAGS+=SA_INCLUDE_NET=no
65.include "${S}/lib/libsa/Makefile.inc"
66LIBSA=		${SALIB}
67
68.if !make(obj) && !make(clean) && !make(cleandir)
69.BEGIN:
70	@([ -h machine ] || ln -s ${S}/arch/${MACHINE}/include machine)
71	@([ -h mips ] || ln -s ${S}/arch/mips/include mips)
72.NOPATH: machine mips
73.endif
74CLEANFILES+= machine mips
75
76
77LIBS=		${LIBSA} ${LIBZ} ${LIBSA} ${LIBKERN}
78
79.include <bsd.prog.mk>
80