Makefile.booters revision 1.3
1# $NetBSD: Makefile.booters,v 1.3 2001/11/22 01:30:03 soren 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
32# PROG set by parent.
33MKMAN=		no
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.
38LOAD_ADDRESS?=		0x88002000
39
40# if there is a 'version' file, add rule for vers.c and add it to SRCS
41# and CLEANFILES
42.if exists(version)
43.PHONY: vers.c
44vers.c: ${.CURDIR}/version
45	sh ${S}/conf/newvers_stand.sh -N ${.CURDIR}/version "sgimips"
46
47SRCS+=	vers.c
48CLEANFILES+= vers.c
49.endif
50
51### find out what to use for libkern
52KERN_AS=	library
53.include "${S}/lib/libkern/Makefile.inc"
54LIBKERN=	${KERNLIB}
55
56### find out what to use for libz
57Z_AS=		library
58.include "${S}/lib/libz/Makefile.inc"
59LIBZ=		${ZLIB}
60
61### find out what to use for libsa
62SA_AS=		library
63SAMISCMAKEFLAGS+=SA_USE_LOADFILE=yes SA_USE_CREAD=yes
64# for now:
65SAMISCMAKEFLAGS+=SA_INCLUDE_NET=no
66.include "${S}/lib/libsa/Makefile.inc"
67LIBSA=		${SALIB}
68
69LIBS=		${LIBSA} ${LIBZ} ${LIBSA} ${LIBKERN}
70
71cleandir distclean: cleanlibdir
72
73cleanlibdir:
74	rm -rf lib
75
76.include <bsd.prog.mk>
77