| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | # $NetBSD: Makefile,v 1.6 2006/08/28 13:42:39 tsutsui Exp $ | | 1 | # $NetBSD: Makefile,v 1.7 2009/03/15 13:57:57 tsutsui Exp $ |
2 | | | 2 | |
3 | .include <bsd.own.mk> | | 3 | .include <bsd.own.mk> |
4 | .include <bsd.sys.mk> # for ${HOST_SH} | | 4 | .include <bsd.sys.mk> # for ${HOST_SH} |
5 | | | 5 | |
6 | S!= cd ${.CURDIR}/../../../..; pwd | | 6 | S!= cd ${.CURDIR}/../../../..; pwd |
7 | | | 7 | |
8 | PROG= boot | | 8 | PROG= boot |
9 | MKMAN= no # defined | | 9 | MKMAN= no # defined |
10 | STRIPFLAG= | | 10 | STRIPFLAG= |
11 | BINMODE= 444 | | 11 | BINMODE= 444 |
12 | | | 12 | |
13 | NETBSD_VERS!= ${HOST_SH} ${S}/conf/osrelease.sh | | 13 | NETBSD_VERS!= ${HOST_SH} ${S}/conf/osrelease.sh |
14 | | | 14 | |
| @@ -24,41 +24,26 @@ LIBCRTEND= | | | @@ -24,41 +24,26 @@ LIBCRTEND= |
24 | AFLAGS= -x assembler-with-cpp -traditional-cpp -mno-abicalls -mips2 | | 24 | AFLAGS= -x assembler-with-cpp -traditional-cpp -mno-abicalls -mips2 |
25 | AFLAGS+= -D_LOCORE -D_KERNEL | | 25 | AFLAGS+= -D_LOCORE -D_KERNEL |
26 | CFLAGS= -Os -mmemcpy -G 1024 | | 26 | CFLAGS= -Os -mmemcpy -G 1024 |
27 | CFLAGS+= -ffreestanding -mno-abicalls -msoft-float -mips2 | | 27 | CFLAGS+= -ffreestanding -mno-abicalls -msoft-float -mips2 |
28 | CFLAGS+= -Werror -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith | | 28 | CFLAGS+= -Werror -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith |
29 | CPPFLAGS+= -nostdinc -I. -I${S} | | 29 | CPPFLAGS+= -nostdinc -I. -I${S} |
30 | CPPFLAGS+= -D_STANDALONE -DNO_ABICALLS -D${MACHINE} | | 30 | CPPFLAGS+= -D_STANDALONE -DNO_ABICALLS -D${MACHINE} |
31 | CPPFLAGS+= -DLIBSA_USE_MEMSET -DLIBSA_USE_MEMCPY | | 31 | CPPFLAGS+= -DLIBSA_USE_MEMSET -DLIBSA_USE_MEMCPY |
32 | CPPFLAGS+= -DNETBSD_VERS='"${NETBSD_VERS}"' | | 32 | CPPFLAGS+= -DNETBSD_VERS='"${NETBSD_VERS}"' |
33 | #CPPFLAGS+= -DBOOT_DEBUG | | 33 | #CPPFLAGS+= -DBOOT_DEBUG |
34 | LDSCRIPT= ${S}/arch/mips/conf/stand.ldscript | | 34 | LDSCRIPT= ${S}/arch/mips/conf/stand.ldscript |
35 | TEXTADDR= 0x80f00000 | | 35 | TEXTADDR= 0x80f00000 |
36 | | | 36 | |
37 | .if !make(obj) && !make(clean) && !make(cleandir) | | | |
38 | .BEGIN: machine mips | | | |
39 | .NOPATH: machine mips | | | |
40 | | | | |
41 | machine:: | | | |
42 | -rm -f $@ | | | |
43 | ln -s ${S}/arch/${MACHINE}/include $@ | | | |
44 | | | | |
45 | mips:: | | | |
46 | -rm -f $@ | | | |
47 | ln -s ${S}/arch/mips/include $@ | | | |
48 | .endif | | | |
49 | | | | |
50 | CLEANFILES+= machine mips | | | |
51 | | | | |
52 | # if there is a 'version' file, add rule for vers.c and add it to SRCS | | 37 | # if there is a 'version' file, add rule for vers.c and add it to SRCS |
53 | # and CLEANFILES | | 38 | # and CLEANFILES |
54 | .if exists(version) | | 39 | .if exists(version) |
55 | .PHONY: vers.c | | 40 | .PHONY: vers.c |
56 | vers.c: ${.CURDIR}/version | | 41 | vers.c: ${.CURDIR}/version |
57 | ${HOST_SH} ${S}/conf/newvers_stand.sh ${.CURDIR}/version ${MACHINE} | | 42 | ${HOST_SH} ${S}/conf/newvers_stand.sh ${.CURDIR}/version ${MACHINE} |
58 | | | 43 | |
59 | SRCS+= vers.c | | 44 | SRCS+= vers.c |
60 | CLEANFILES+= vers.c | | 45 | CLEANFILES+= vers.c |
61 | .endif | | 46 | .endif |
62 | | | 47 | |
63 | ### find out what to use for libsa | | 48 | ### find out what to use for libsa |
64 | SAMISCMAKEFLAGS= SA_USE_CREAD=yes SA_USE_LOADFILE=yes | | 49 | SAMISCMAKEFLAGS= SA_USE_CREAD=yes SA_USE_LOADFILE=yes |
| @@ -79,14 +64,15 @@ cleandir distclean: cleanlibdir | | | @@ -79,14 +64,15 @@ cleandir distclean: cleanlibdir |
79 | cleanlibdir: | | 64 | cleanlibdir: |
80 | -rm -rf lib | | 65 | -rm -rf lib |
81 | | | 66 | |
82 | ${PROG}: ${OBJS} ${LIBS} | | 67 | ${PROG}: ${OBJS} ${LIBS} |
83 | ${LD} -Map ${PROG}.map -N -x -Ttext ${TEXTADDR} -T ${LDSCRIPT} \ | | 68 | ${LD} -Map ${PROG}.map -N -x -Ttext ${TEXTADDR} -T ${LDSCRIPT} \ |
84 | -e start -o ${PROG}.elf ${OBJS} ${LIBS} | | 69 | -e start -o ${PROG}.elf ${OBJS} ${LIBS} |
85 | @${SIZE} ${PROG}.elf | | 70 | @${SIZE} ${PROG}.elf |
86 | ${OBJCOPY} --impure -O ecoff-littlemips \ | | 71 | ${OBJCOPY} --impure -O ecoff-littlemips \ |
87 | -R .pdr -R .mdebug.abi32 -R .comment -R .ident \ | | 72 | -R .pdr -R .mdebug.abi32 -R .comment -R .ident \ |
88 | ${PROG}.elf ${.TARGET} | | 73 | ${PROG}.elf ${.TARGET} |
89 | | | 74 | |
90 | CLEANFILES+= ${PROG}.elf ${PROG}.map | | 75 | CLEANFILES+= ${PROG}.elf ${PROG}.map |
91 | | | 76 | |
| | | 77 | .include <bsd.klinks.mk> |
92 | .include <bsd.prog.mk> | | 78 | .include <bsd.prog.mk> |