Makefile.booters revision 1.19 1 # $NetBSD: Makefile.booters,v 1.19 2011/01/24 19:26:16 joerg 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 AFLAGS+= -D_LOCORE -D_KERNEL -mno-abicalls
24 CPPFLAGS+= -nostdinc -D_STANDALONE -DNO_ABICALLS -I${.OBJDIR} -I${S}
25 # compiler flags for smallest code size
26 CFLAGS= -ffreestanding -Os -Wall -Werror -mno-abicalls -msoft-float -G 1024
27 .if ${MACHINE_ARCH} == "mips64eb"
28 CPUFLAGS+= -mabi=n32
29 LDFLAGS+= -mabi=n32
30 .endif
31 CWARNFLAGS+= -Wall -Werror
32 CWARNFLAGS+= -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith
33 CWARNFLAGS+= -Wno-pointer-sign
34 LDBUG= -T $S/arch/mips/conf/stand.ldscript
35 NETBSD_VERS!= ${HOST_SH} ${.CURDIR}/../../../../conf/osrelease.sh
36 CPPFLAGS+= -DNETBSD_VERS='"${NETBSD_VERS}"'
37
38 CPPFLAGS+= -Dsgimips
39
40 # We load the kernel at 420K in from the start of RAM to give the boot
41 # loader plenty of breathing room. Load the boot loader starting at
42 # the second page of RAM.
43 # A warm thank-you to SGI for making load addresses different :)
44 LOAD_ADDRESS?= 0x88002000
45 LOAD_ADDRESS_IP32?= 0x80002000
46
47 # if there is a 'version' file, add rule for vers.c and add it to SRCS
48 # and CLEANFILES
49 .if exists(version)
50 .PHONY: vers.c
51 vers.c: ${.CURDIR}/version
52 ${HOST_SH} ${S}/conf/newvers_stand.sh ${${MKREPRO} == "yes" :?:-D} \
53 ${.CURDIR}/version "sgimips"
54
55 SRCS+= vers.c
56 CLEANFILES+= vers.c
57 .endif
58
59 ### find out what to use for libkern
60 KERN_AS= library
61 .include "${S}/lib/libkern/Makefile.inc"
62 LIBKERN= ${KERNLIB}
63
64 ### find out what to use for libz
65 Z_AS= library
66 .include "${S}/lib/libz/Makefile.inc"
67 LIBZ= ${ZLIB}
68
69 ### find out what to use for libsa
70 SA_AS= library
71 SAMISCMAKEFLAGS+=SA_USE_LOADFILE=yes SA_USE_CREAD=yes
72 # for now:
73 SAMISCMAKEFLAGS+=SA_INCLUDE_NET=no
74 .include "${S}/lib/libsa/Makefile.inc"
75 LIBSA= ${SALIB}
76
77
78 LIBS= ${LIBSA} ${LIBZ} ${LIBSA} ${LIBKERN}
79
80 .include <bsd.klinks.mk>
81 .include <bsd.prog.mk>
82