1 # $NetBSD: Makefile.bootxx,v 1.8 2008/10/25 22:27:36 apb Exp $
3 SRCS = start.S bootxx.c booted_dev.c blkdev.c prom.c prom_disp.S \
4 putstr.c panic_putstr.c
6 # XXX sometimes useful for debugging
9 BOOT_RELOC = ${PRIMARY_LOAD_ADDRESS}
11 CPPFLAGS += ${PRIMARY_CPPFLAGS} \
12 -DLIBSA_FS_SINGLECOMPONENT -DLIBSA_NO_FS_WRITE \
13 -DLIBSA_NO_FS_CLOSE -DLIBSA_NO_FS_SEEK \
14 -DLIBSA_SINGLE_DEVICE=blkdev \
15 -D"blkdevioctl(x,y,z)=EINVAL" -D"blkdevclose(f)=0" \
17 -DLIBSA_NO_FD_CHECKING \
18 -DLIBSA_NO_RAW_ACCESS \
19 -DLIBSA_NO_DISKLABEL_MSGS
21 CLEANFILES+= ${PROG}.sym ${PROG}.map ${PROG}.lds
24 @echo creating ${PROG} from ${PROG}.sym...
25 @${OBJCOPY} --output-target=binary ${PROG}.sym ${PROG}
28 @${CHECKSIZE_CMD} ${PROG}.sym ${PROG} ${PRIMARY_MAX_LOAD} \
29 ${PRIMARY_MAX_TOTAL} || (rm -f ${PROG} ; false)
31 SAMISCMAKEFLAGS= SA_INCLUDE_NET=no SA_USE_CREAD=no
32 .include "../Makefile.bootprogs"
34 # We need to strip out the .eh_frame section from the final object.
35 # To do this, we get the linker's idea of the ldscript, and assign
36 # any .eh_frame sections to the special "DISCARD" section so that
37 # they are not included in the final object.
39 ${PROG}.sym: ${OBJS} ${LIBSA} ${LIBKERN}
40 @${LD} -Ttext 0x20000000 -N --verbose 2>&1 \
41 | ${TOOL_SED} -n '/^==========/,/^===========/{/^========/d; \
42 s,^[[:blank:]]*\.eh_frame[[:blank:]]*:, /DISCARD/ : ,;p;}' \
44 ${LD} -T ${PROG}.lds -Ttext ${BOOT_RELOC} -N -e start \
45 -o ${PROG}.sym ${OBJS} ${LIBSA} ${LIBKERN} -Map ${PROG}.map
46 @chmod 644 ${PROG}.sym