xref: /netbsd/sys/arch/sgimips/stand/Makefile.booters (revision bf9ec67e)
1# $NetBSD: Makefile.booters,v 1.6 2001/12/20 20:30:59 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
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=		-Os -g -mmemcpy -mno-abicalls -G 128
27LDBUG=		-T $S/arch/mips/conf/stand.ldscript
28
29NETBSD_VERS!=	sh ${.CURDIR}/../../../../conf/osrelease.sh
30CPPFLAGS+=	-DNETBSD_VERS='"${NETBSD_VERS}"'
31
32CPPFLAGS+=	-Dsgimips
33
34# PROG set by parent.
35NOMAN=		# defined
36
37# We load the kernel at 420K in from the start of RAM to give the boot
38# loader plenty of breathing room.  Load the boot loader starting at
39# the second page of RAM.
40LOAD_ADDRESS?=		0x88002000
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	sh ${S}/conf/newvers_stand.sh -N ${.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
71LIBS=		${LIBSA} ${LIBZ} ${LIBSA} ${LIBKERN}
72
73.include <bsd.prog.mk>
74