1 # $NetBSD: Makefile,v 1.7 2009/03/15 13:57:57 tsutsui Exp $
4 .
include <bsd.sys.mk
> # for ${HOST_SH}
6 S
!= cd
${.CURDIR
}/..
/..
/..
/..
; pwd
13 NETBSD_VERS
!= ${HOST_SH} ${S}/conf
/osrelease.sh
16 SRCS
+= boot.c bootinfo.c conf.c devopen.c disk.c getchar.c getopt.c putchar.c
18 # XXX SHOULD NOT NEED TO DEFINE THESE!
24 AFLAGS
= -x assembler-with-cpp
-traditional-cpp
-mno-abicalls
-mips2
25 AFLAGS
+= -D_LOCORE
-D_KERNEL
26 CFLAGS
= -Os
-mmemcpy
-G
1024
27 CFLAGS
+= -ffreestanding
-mno-abicalls
-msoft-float
-mips2
28 CFLAGS
+= -Werror
-Wall
-Wstrict-prototypes
-Wmissing-prototypes
-Wpointer-arith
29 CPPFLAGS
+= -nostdinc
-I.
-I
${S}
30 CPPFLAGS
+= -D_STANDALONE
-DNO_ABICALLS
-D
${MACHINE}
31 CPPFLAGS
+= -DNETBSD_VERS
='"${NETBSD_VERS}"'
32 #CPPFLAGS+= -DBOOT_DEBUG
33 LDSCRIPT
= ${S}/arch
/mips
/conf
/stand.ldscript
36 # if there is a 'version' file, add rule for vers.c and add it to SRCS
40 vers.c
: ${.CURDIR
}/version
41 ${HOST_SH} ${S}/conf
/newvers_stand.sh
${.CURDIR
}/version
${MACHINE}
47 ### find out what to use for libsa
48 SAMISCMAKEFLAGS
= SA_USE_CREAD
=yes SA_USE_LOADFILE
=yes
49 .
include "${S}/lib/libsa/Makefile.inc"
52 ### find out what to use for libkern
53 .
include "${S}/lib/libkern/Makefile.inc"
56 ### find out what to use for libz
57 .
include "${S}/lib/libz/Makefile.inc"
60 LIBS
= ${LIBSA} ${LIBKERN} ${LIBZ}
62 cleandir
distclean: cleanlibdir
66 ${PROG}: ${OBJS} ${LIBS}
67 ${LD} -Map
${PROG}.map
-N
-x
-Ttext
${TEXTADDR} -T
${LDSCRIPT} \
68 -e start
-o
${PROG}.elf
${OBJS} ${LIBS}
70 ${OBJCOPY} --impure
-O ecoff-littlemips \
71 -R .pdr
-R .mdebug.abi32
-R .comment
-R .ident \
72 ${PROG}.elf
${.TARGET
}
74 CLEANFILES
+= ${PROG}.elf
${PROG}.map
76 .
include <bsd.klinks.mk
>
77 .
include <bsd.prog.mk
>