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