Makefile.booters revision 1.10
1# $NetBSD: Makefile.booters,v 1.10 2003/10/26 07:25:37 lukem 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
16.PHONY: machine-links
17beforedepend: machine-links
18# ${MACHINE} then ${MACHINE_ARCH}
19machine-links:
20	-rm -f machine && \
21	    ln -s $S/arch/${MACHINE}/include machine
22	-rm -f mips && \
23	    ln -s $S/arch/mips/include mips
24CLEANFILES+= machine mips
25
26realall: machine-links ${PROG}
27
28.PATH:		${.CURDIR}/../common
29AFLAGS+=	-D_LOCORE -D_KERNEL -mno-abicalls
30# -I${.CURDIR}/../.. done by Makefile.inc
31#CPPFLAGS+=	-nostdinc -D_STANDALONE -DNO_ABICALLS -DHEAP_VARIABLE -I${.OBJDIR} -I${S}
32CPPFLAGS+=	-nostdinc -D_STANDALONE -DNO_ABICALLS -I${.OBJDIR} -I${S}
33# compiler flags for smallest code size
34CFLAGS=		-ffreestanding -Os -g -mmemcpy -mno-abicalls -msoft-float -G 128
35LDBUG=		-T $S/arch/mips/conf/stand.ldscript
36NETBSD_VERS!=	${HOST_SH} ${.CURDIR}/../../../../conf/osrelease.sh
37CPPFLAGS+=	-DNETBSD_VERS='"${NETBSD_VERS}"'
38
39CPPFLAGS+=	-Dsgimips
40
41# PROG set by parent.
42NOMAN=		# defined
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 -N ${.CURDIR}/version "sgimips"
57
58SRCS+=	vers.c
59CLEANFILES+= vers.c
60.endif
61
62### find out what to use for libkern
63KERN_AS=	library
64.include "${S}/lib/libkern/Makefile.inc"
65LIBKERN=	${KERNLIB}
66
67### find out what to use for libz
68Z_AS=		library
69.include "${S}/lib/libz/Makefile.inc"
70LIBZ=		${ZLIB}
71
72### find out what to use for libsa
73SA_AS=		library
74SAMISCMAKEFLAGS+=SA_USE_LOADFILE=yes SA_USE_CREAD=yes
75# for now:
76SAMISCMAKEFLAGS+=SA_INCLUDE_NET=no
77.include "${S}/lib/libsa/Makefile.inc"
78LIBSA=		${SALIB}
79
80LIBS=		${LIBSA} ${LIBZ} ${LIBSA} ${LIBKERN}
81
82.include <bsd.prog.mk>
83