xref: /netbsd/sys/arch/sgimips/stand/Makefile.booters (revision c4a72b64)
1# $NetBSD: Makefile.booters,v 1.7 2002/11/10 17:12:58 thorpej Exp $
2
3# $S must correspond to the top of the 'sys' tree
4S=	${.CURDIR}/../../../..
5
6BINMODE?=	444
7
8.PHONY: machine-links
9beforedepend: machine-links
10# ${MACHINE} then ${MACHINE_ARCH}
11machine-links:
12	-rm -f machine && \
13	    ln -s $S/arch/${MACHINE}/include machine
14	-rm -f mips && \
15	    ln -s $S/arch/mips/include mips
16CLEANFILES+= machine mips
17
18realall: machine-links ${PROG}
19
20.PATH:		${.CURDIR}/../common
21AFLAGS+=	-D_LOCORE -D_KERNEL -mno-abicalls
22# -I${.CURDIR}/../.. done by Makefile.inc
23#CPPFLAGS+=	-nostdinc -D_STANDALONE -DNO_ABICALLS -DHEAP_VARIABLE -I${.OBJDIR} -I${S}
24CPPFLAGS+=	-nostdinc -D_STANDALONE -DNO_ABICALLS -I${.OBJDIR} -I${S}
25# compiler flags for smallest code size
26CFLAGS=		-ffreestanding -Os -g -mmemcpy -mno-abicalls -msoft-float -G 128
27LDBUG=		-T $S/arch/mips/conf/stand.ldscript
28NETBSD_VERS!=	sh ${.CURDIR}/../../../../conf/osrelease.sh
29CPPFLAGS+=	-DNETBSD_VERS='"${NETBSD_VERS}"'
30
31CPPFLAGS+=	-Dsgimips
32
33# PROG set by parent.
34NOMAN=		# defined
35
36# We load the kernel at 420K in from the start of RAM to give the boot
37# loader plenty of breathing room.  Load the boot loader starting at
38# the second page of RAM.
39LOAD_ADDRESS?=		0x88002000
40
41# if there is a 'version' file, add rule for vers.c and add it to SRCS
42# and CLEANFILES
43.if exists(version)
44.PHONY: vers.c
45vers.c: ${.CURDIR}/version
46	sh ${S}/conf/newvers_stand.sh -N ${.CURDIR}/version "sgimips"
47
48SRCS+=	vers.c
49CLEANFILES+= vers.c
50.endif
51
52### find out what to use for libkern
53KERN_AS=	library
54.include "${S}/lib/libkern/Makefile.inc"
55LIBKERN=	${KERNLIB}
56
57### find out what to use for libz
58Z_AS=		library
59.include "${S}/lib/libz/Makefile.inc"
60LIBZ=		${ZLIB}
61
62### find out what to use for libsa
63SA_AS=		library
64SAMISCMAKEFLAGS+=SA_USE_LOADFILE=yes SA_USE_CREAD=yes
65# for now:
66SAMISCMAKEFLAGS+=SA_INCLUDE_NET=no
67.include "${S}/lib/libsa/Makefile.inc"
68LIBSA=		${SALIB}
69
70LIBS=		${LIBSA} ${LIBZ} ${LIBSA} ${LIBKERN}
71
72.include <bsd.prog.mk>
73