Makefile.booters revision 1.21 1 # $NetBSD: Makefile.booters,v 1.21 2011/02/26 16:26:58 matt Exp $
2
3 # PROG set by parent.
4 NOMAN= # defined
5
6 .include <bsd.own.mk>
7 .include <bsd.sys.mk> # for HOST_SH
8
9 # $S must correspond to the top of the 'sys' tree
10 S= ${.CURDIR}/../../../..
11
12 BINMODE?= 444
13
14 # XXX SHOULD NOT NEED TO DEFINE THESE!
15 LIBCRT0=
16 LIBC=
17 LIBCRTBEGIN=
18 LIBCRTEND=
19
20 realall: ${PROG}
21
22 .PATH: ${.CURDIR}/../common
23 .PATH.S: ${S}/dev/arcbios
24 AFLAGS+= -D_LOCORE -D_KERNEL -mno-abicalls
25 CPPFLAGS+= -nostdinc -D_STANDALONE -DNO_ABICALLS -I${.OBJDIR} -I${S}
26 # compiler flags for smallest code size
27 CFLAGS= -ffreestanding -Os -Wall -Werror -mno-abicalls -msoft-float -G 1024
28 .if ${MACHINE_ARCH} == "mips64eb"
29 AFLAGS+= -mips3 -mabi=32
30 CFLAGS+= -mips3 -mabi=32
31 .endif
32 CWARNFLAGS+= -Wall -Werror
33 CWARNFLAGS+= -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith
34 CWARNFLAGS+= -Wno-pointer-sign
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 .include "${S}/dev/arcbios/Makefile.inc"
42
43 # We load the kernel at 420K in from the start of RAM to give the boot
44 # loader plenty of breathing room. Load the boot loader starting at
45 # the second page of RAM.
46 # A warm thank-you to SGI for making load addresses different :)
47 LOAD_ADDRESS?= 0x88002000
48 LOAD_ADDRESS_IP32?= 0x80002000
49
50 # if there is a 'version' file, add rule for vers.c and add it to SRCS
51 # and CLEANFILES
52 .if exists(version)
53 .PHONY: vers.c
54 vers.c: ${.CURDIR}/version
55 ${HOST_SH} ${S}/conf/newvers_stand.sh ${${MKREPRO} == "yes" :?:-D} \
56 ${.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
81 LIBS= ${LIBSA} ${LIBZ} ${LIBSA} ${LIBKERN}
82
83 .include <bsd.klinks.mk>
84 .include <bsd.prog.mk>
85