Makefile.bootxx revision 1.3 1 # $NetBSD: Makefile.bootxx,v 1.3 2006/06/28 16:28:51 lukem Exp $
2
3 NOMAN =
4
5 BINMODE = 0444
6
7 S = ${.CURDIR}/../../../..
8 COMMON = ${.CURDIR}/../common
9
10 .PATH: ${COMMON}
11
12 PROG = ${BASE}
13 SRCS += entry.S bootxx.c
14 SRCS += boot_device.c floppy_2d.c floppy_2hd_ibmpc.c
15 #SRCS += floppy_2hc.c
16 BINMODE = 444
17
18 LINKFLAGS = -T ${COMMON}/bootxx.ldscript -S -N
19 MIPSFLAGS = -mips1 -G 0 -mno-abicalls
20 DEBUGFLAGS = -Wall -Werror
21 DEBUGFLAGS += -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith
22 DEBUGFLAGS += -Wno-format-zero-length -Wno-sign-compare
23 OPTFLAGS = -Os -mmemcpy
24 FLAGS = ${MIPSFLAGS} ${DEBUGFLAGS} ${OPTFLAGS}
25 AFLAGS = -xassembler-with-cpp -D_LOCORE ${FLAGS}
26 CFLAGS = ${FLAGS} -ffreestanding
27
28 CPPFLAGS += -D_STANDALONE
29 CPPFLAGS += -nostdinc -I${.OBJDIR} -I${COMMON} -I${S}
30 CPPFLAGS += -D__daddr_t=int32_t
31
32 CLEANFILES += ${PROG} ${PROG}.bin ${PROG}.elf ${PROG}.tmp machine mips
33
34 KERN_AS = library
35 .include "${S}/lib/libkern/Makefile.inc"
36 LIBKERN = ${KERNLIB}
37
38 LIBS = ${LIBKERN}
39
40 .if !make(obj) && !make(clean) && !make(cleandir)
41 .BEGIN:
42 @[ -h machine ] || ln -s $S/arch/${MACHINE}/include machine
43 @[ -h mips ] || ln -s $S/arch/mips/include mips
44 .NOPATH: machine mips
45 .endif
46
47 ${PROG}: ${OBJS} ${LIBS}
48 ${_MKTARGET_LINK}
49 ${LD} ${LINKFLAGS} -o ${PROG}.elf ${OBJS} ${LIBS}
50 ${OBJCOPY} -O binary ${PROG}.elf ${BASE}.bin
51 ls -al ${BASE}.bin
52 dd if=${BASE}.bin of=${PROG}.tmp bs=4096 conv=sync
53 mv ${PROG}.tmp ${PROG}
54 ls -al ${PROG}
55 # -rm -f ${BASE}.tmp
56
57 clean cleandir distclean: cleanlibdir
58
59 cleanlibdir:
60 -rm -rf lib
61
62 .include <bsd.prog.mk>
63