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