Makefile.bootxx revision 1.9
11.9Stsutsui# $NetBSD: Makefile.bootxx,v 1.9 2009/04/03 10:38:12 tsutsui Exp $
21.1Scgd
31.1ScgdSRCS = start.S bootxx.c booted_dev.c blkdev.c prom.c prom_disp.S \
41.1Scgd       putstr.c panic_putstr.c
51.3Scgd
61.3Scgd# XXX sometimes useful for debugging
71.3Scgd# SRCS += putulong.c
81.1Scgd
91.1ScgdBOOT_RELOC = ${PRIMARY_LOAD_ADDRESS}
101.1Scgd
111.1ScgdCPPFLAGS += ${PRIMARY_CPPFLAGS} \
121.1Scgd		-DLIBSA_FS_SINGLECOMPONENT -DLIBSA_NO_FS_WRITE \
131.1Scgd		-DLIBSA_NO_FS_CLOSE -DLIBSA_NO_FS_SEEK \
141.1Scgd		-DLIBSA_SINGLE_DEVICE=blkdev \
151.1Scgd		  -D"blkdevioctl(x,y,z)=EINVAL" -D"blkdevclose(f)=0" \
161.1Scgd		-DLIBSA_NO_TWIDDLE \
171.1Scgd		-DLIBSA_NO_FD_CHECKING \
181.1Scgd		-DLIBSA_NO_RAW_ACCESS \
191.9Stsutsui		-DLIBSA_NO_DISKLABEL_MSGS
201.1Scgd
211.6SsimonbCLEANFILES+= ${PROG}.sym ${PROG}.map ${PROG}.lds
221.1Scgd
231.1Scgd${PROG}: ${PROG}.sym
241.1Scgd	@echo creating ${PROG} from ${PROG}.sym...
251.4Stv	@${OBJCOPY} --output-target=binary ${PROG}.sym ${PROG}
261.1Scgd	@chmod 644 ${PROG}
271.1Scgd	@ls -l ${PROG}
281.1Scgd	@${CHECKSIZE_CMD} ${PROG}.sym ${PROG} ${PRIMARY_MAX_LOAD} \
291.1Scgd	    ${PRIMARY_MAX_TOTAL} || (rm -f ${PROG} ; false)
301.1Scgd
311.1ScgdSAMISCMAKEFLAGS= SA_INCLUDE_NET=no SA_USE_CREAD=no
321.1Scgd.include "../Makefile.bootprogs"
331.1Scgd
341.6Ssimonb# We need to strip out the .eh_frame section from the final object.
351.6Ssimonb# To do this, we get the linker's idea of the ldscript, and assign
361.6Ssimonb# any .eh_frame sections to the special "DISCARD" section so that
371.6Ssimonb# they are not included in the final object.
381.6Ssimonb
391.1Scgd${PROG}.sym: ${OBJS} ${LIBSA} ${LIBKERN}
401.6Ssimonb	@${LD} -Ttext 0x20000000 -N --verbose 2>&1 \
411.8Sapb	    | ${TOOL_SED} -n '/^==========/,/^===========/{/^========/d; \
421.6Ssimonb	    s,^[[:blank:]]*\.eh_frame[[:blank:]]*:,  /DISCARD/ : ,;p;}' \
431.6Ssimonb	    > ${PROG}.lds
441.6Ssimonb	${LD} -T ${PROG}.lds -Ttext ${BOOT_RELOC} -N -e start \
451.6Ssimonb	    -o ${PROG}.sym ${OBJS} ${LIBSA} ${LIBKERN} -Map ${PROG}.map
461.1Scgd	@chmod 644 ${PROG}.sym
471.1Scgd	@${SIZE} ${PROG}.sym
48