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
6 S= ${.CURDIR}/../../../..
7
8 BINMODE?= 444
9
10 # XXX SHOULD NOT NEED TO DEFINE THESE!
11 LIBCRT0=
12 LIBC=
13 LIBCRTBEGIN=
14 LIBCRTEND=
15
16 .PHONY: machine-links
17 beforedepend: machine-links
18 # ${MACHINE} then ${MACHINE_ARCH}
19 machine-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
24 CLEANFILES+= machine mips
25
26 realall: machine-links ${PROG}
27
28 .PATH: ${.CURDIR}/../common
29 AFLAGS+= -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}
32 CPPFLAGS+= -nostdinc -D_STANDALONE -DNO_ABICALLS -I${.OBJDIR} -I${S}
33 # compiler flags for smallest code size
34 CFLAGS= -ffreestanding -Os -g -mmemcpy -mno-abicalls -msoft-float -G 128
35 LDBUG= -T $S/arch/mips/conf/stand.ldscript
36 NETBSD_VERS!= ${HOST_SH} ${.CURDIR}/../../../../conf/osrelease.sh
37 CPPFLAGS+= -DNETBSD_VERS='"${NETBSD_VERS}"'
38
39 CPPFLAGS+= -Dsgimips
40
41 # PROG set by parent.
42 NOMAN= # 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 :)
48 LOAD_ADDRESS?= 0x88002000
49 LOAD_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
55 vers.c: ${.CURDIR}/version
56 ${HOST_SH} ${S}/conf/newvers_stand.sh -N ${.CURDIR}/version "sgimips"
57
58 SRCS+= vers.c
59 CLEANFILES+= vers.c
60 .endif
61
62 ### find out what to use for libkern
63 KERN_AS= library
64 .include "${S}/lib/libkern/Makefile.inc"
65 LIBKERN= ${KERNLIB}
66
67 ### find out what to use for libz
68 Z_AS= library
69 .include "${S}/lib/libz/Makefile.inc"
70 LIBZ= ${ZLIB}
71
72 ### find out what to use for libsa
73 SA_AS= library
74 SAMISCMAKEFLAGS+=SA_USE_LOADFILE=yes SA_USE_CREAD=yes
75 # for now:
76 SAMISCMAKEFLAGS+=SA_INCLUDE_NET=no
77 .include "${S}/lib/libsa/Makefile.inc"
78 LIBSA= ${SALIB}
79
80 LIBS= ${LIBSA} ${LIBZ} ${LIBSA} ${LIBKERN}
81
82 .include <bsd.prog.mk>
83