Makefile.booters revision 1.20 1 # $NetBSD: Makefile.booters,v 1.20 2011/02/20 07:59:51 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 CPUFLAGS+= -mips3 -mabi=32
30 LDFLAGS+= -mips3 -mabi=32
31 MACHINE_ARCH= mipseb
32 .endif
33 CWARNFLAGS+= -Wall -Werror
34 CWARNFLAGS+= -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith
35 CWARNFLAGS+= -Wno-pointer-sign
36 LDBUG= -T $S/arch/mips/conf/stand.ldscript
37 NETBSD_VERS!= ${HOST_SH} ${.CURDIR}/../../../../conf/osrelease.sh
38 CPPFLAGS+= -DNETBSD_VERS='"${NETBSD_VERS}"'
39
40 CPPFLAGS+= -Dsgimips
41
42 .include "${S}/dev/arcbios/Makefile.inc"
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 ${${MKREPRO} == "yes" :?:-D} \
57 ${.CURDIR}/version "sgimips"
58
59 SRCS+= vers.c
60 CLEANFILES+= vers.c
61 .endif
62
63 ### find out what to use for libkern
64 KERN_AS= library
65 .include "${S}/lib/libkern/Makefile.inc"
66 LIBKERN= ${KERNLIB}
67
68 ### find out what to use for libz
69 Z_AS= library
70 .include "${S}/lib/libz/Makefile.inc"
71 LIBZ= ${ZLIB}
72
73 ### find out what to use for libsa
74 SA_AS= library
75 SAMISCMAKEFLAGS+=SA_USE_LOADFILE=yes SA_USE_CREAD=yes
76 # for now:
77 SAMISCMAKEFLAGS+=SA_INCLUDE_NET=no
78 .include "${S}/lib/libsa/Makefile.inc"
79 LIBSA= ${SALIB}
80
81
82 LIBS= ${LIBSA} ${LIBZ} ${LIBSA} ${LIBKERN}
83
84 .include <bsd.klinks.mk>
85 .include <bsd.prog.mk>
86