Sync usage with man page.
[netbsd-mini2440.git] / sys / arch / ews4800mips / stand / boot / Makefile
bloba7af788c71c01eaf4b7387a7c703bd7400155494
1 # $NetBSD: Makefile,v 1.9 2009/03/15 06:17:03 tsutsui Exp $
3 WARNS ?= 1
4 NOMAN =
6 BINMODE = 444
8 S = ${.CURDIR}/../../../..
9 COMMON = ${.CURDIR}/../common
11 LIBSADIR = ${S}/lib/libsa
12 SYSVBFSDIR = ${S}/fs/sysvbfs
13 EWS4800MIPSDIR = ${.CURDIR}/../../ews4800mips
14 DEVDIR = ${.CURDIR}/../../dev
16 # XXX SHOULD NOT NEED TO DEFINE THESE!
17 LIBCRT0=
18 LIBC=
19 LIBCRTBEGIN=
20 LIBCRTEND=
22 .PATH: ${COMMON} ${LIBSADIR} ${SYSVBFSDIR} \
23 ${EWS4800MIPSDIR} ${SBDDIR} ${DEVDIR}
25 COFFHDRFIX = ${.OBJDIR}/coffhdrfix
27 PROG = boot
28 BOOT_KERNEL = boot_kernel
29 FILES += ${PROG}.coff ${BOOT_KERNEL}.gz # XXX hack to install these
30 SRCS = start.S boot.c prompt.c delay.c cmd.c loader.c
31 SRCS += bfs_subr.o disk.c diskutil.c
32 SRCS += devopen.c datafs.c bootfs.c ustarfs.c
33 SRCS += lance.c ether_if.c
34 SRCS += device_test.c cop0.c mem.c
35 SRCS += boot_device.c floppy_2d.c floppy_2hd_ibmpc.c
36 #SRCS += floppy_2hc.c
37 SRCS += console.c cons_rom.c cons_fb.c cons_zskbd.c cons_zs.c
38 BINKERNEL_C = ${COMMON}/binkernel.c
39 BINKERNEL_SIZE = '2 * 1024 * 1024'
40 BINKERNEL_O = binkernel.o
41 BINKERNEL_DUMMY_O= binkernel_dummy.o
43 # ${S}/lib/libsa
44 SRCS += dev_net.c
45 # ${S}/fs/sysvbfs
46 SRCS += bfs.c
47 # ../../dev
48 SRCS += ga.c
49 # ../../ews4800mips
50 SRCS += pdinfo.c vtoc.c
52 .PHONY: vers.c
53 vers.c: version
54 ${_MKTARGET_CREATE}
55 ${HOST_SH} ${S}/conf/newvers_stand.sh -DM ${.CURDIR}/version ${MACHINE}
57 SRCS+= vers.c
58 CLEANFILES+= vers.c
60 TEXTADDR = 0xa0a00000
61 LINKFLAGS = -T ${S}/arch/mips/conf/stand.ldscript -Ttext ${TEXTADDR} \
62 -e start -N
63 COFFLDFLAGS = -T ${COMMON}/coffboot.ldscript -N
65 MIPSFLAGS = -mips1 -G 0 -mno-abicalls
66 DEBUGFLAGS = -Wall -Werror
67 DEBUGFLAGS += -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith
68 DEBUGFLAGS += -Wno-format-zero-length -Wno-sign-compare
69 OPTFLAGS = -Os -mmemcpy
70 FLAGS = ${MIPSFLAGS} ${DEBUGFLAGS} ${OPTFLAGS}
71 AFLAGS = -xassembler-with-cpp -D_LOCORE ${FLAGS}
72 CFLAGS = ${FLAGS} -ffreestanding
74 CPPFLAGS += -D_STANDALONE -DSUPPORT_BOOTP
75 CPPFLAGS += -nostdinc -I${.OBJDIR} -I${.CURDIR} -I${COMMON} -I${S}
76 CPPFLAGS += -D__daddr_t=int32_t
77 #CPPFLAGS += -DBOOTP_DEBUG -DNETIF_DEBUG -DETHER_DEBUG -DNFS_DEBUG
78 #CPPFLAGS += -DRPC_DEBUG -DRARP_DEBUG -DNET_DEBUG -DDEBUG -DPARANOID
80 CLEANFILES += ${BINKERNEL_DUMMY_O} ${BINKERNEL_O}
81 CLEANFILES += ${PROG} ${PROG}.elf ${PROG}.coff ${PROG}.tmp ${PROG}.dis
82 CLEANFILES += ${COFFHDRFIX}
83 CLEANFILES += ${BOOT_KERNEL} ${BOOT_KERNEL}.elf ${BOOT_KERNEL}.tmp
84 CLEANFILES += ${BOOT_KERNEL}.gz ${BOOT_KERNEL}.gz.tmp
86 .include "${S}/lib/libkern/Makefile.inc"
87 LIBKERN= ${KERNLIB}
89 .include "${S}/lib/libz/Makefile.inc"
90 LIBZ= ${ZLIB}
92 SAMISCMAKEFLAGS= SA_USE_CREAD=yes SA_USE_LOADFILE=yes
93 .include "${S}/lib/libsa/Makefile.inc"
94 LIBSA= ${SALIB}
96 LIBS = ${LIBSA} ${LIBZ} ${LIBKERN}
98 # fixup GNU binutils file offset error.
99 coffhdrfix: ${COMMON}/coffhdrfix.c
100 ${HOST_CC} -o ${COFFHDRFIX} ${COMMON}/coffhdrfix.c
102 clean cleandir distclean: cleanlibdir
104 cleanlibdir:
105 -rm -rf lib
107 ${BINKERNEL_DUMMY_O}: ${BINKERNEL_C}
108 ${_MKTARGET_COMPILE}
109 ${COMPILE.c} -DKERNEL_SIZE=0 ${BINKERNEL_C} -o ${.TARGET}
111 ${BINKERNEL_O}: ${BINKERNEL_C}
112 ${_MKTARGET_COMPILE}
113 ${COMPILE.c} -DKERNEL_SIZE=${BINKERNEL_SIZE} ${BINKERNEL_C} \
114 -o ${.TARGET}
116 all realall: ${PROG}.coff ${BOOT_KERNEL}.gz
118 ${PROG}: ${BINKERNEL_DUMMY_O} ${OBJS} ${LIBS}
119 ${_MKTARGET_LINK}
120 ${LD} ${LINKFLAGS} -S -o ${PROG}.elf ${OBJS} ${LIBS} \
121 ${BINKERNEL_DUMMY_O}
122 ${OBJDUMP} -h ${PROG}.elf
123 # ${OBJDUMP} -m mips:4000 -d ${PROG}.elf > ${PROG}.dis
124 mv ${PROG}.elf ${PROG}
125 ls -al ${PROG}
127 .include <bsd.klinks.mk>
128 .include <bsd.prog.mk>
130 ${PROG}.coff: ${PROG}
131 ${_MKTARGET_CREATE}
132 ${ELF2ECOFF} ${PROG} ${.TARGET}.tmp
133 mv ${.TARGET}.tmp ${.TARGET}
135 ${BOOT_KERNEL}.gz: ${BINKERNEL_O} ${OBJS} ${LIBS}
136 ${_MKTARGET_LINK}
137 ${LD} ${LINKFLAGS} -o ${BOOT_KERNEL}.elf ${OBJS} ${LIBS} \
138 ${BINKERNEL_O}
139 mv ${BOOT_KERNEL}.elf ${BOOT_KERNEL}
140 ${OBJDUMP} -h ${BOOT_KERNEL}
141 gzip -9c ${BOOT_KERNEL} > ${.TARGET}.tmp
142 mv ${.TARGET}.tmp ${.TARGET}
143 ls -al ${.TARGET}