# $NetBSD: Makefile.bootxx,v 1.33 2008/10/20 03:02:07 christos Exp $ S= ${.CURDIR}/../../../../../ PIE_CFLAGS= PIE_LDFLAGS= PIE_AFLAGS= NOMAN= PROG?= bootxx_${FS} BINDIR= /usr/mdec PRIMARY_LOAD_ADDRESS=0x10000 SECONDARY_LOAD_ADDRESS=0x80000 # We ought (need?) to fit in the ffs 8k hole # This restricts us to 14 sectors BOOTXX_SECTORS?=14 BOOTXX_MAXSIZE?= $$(( ${BOOTXX_SECTORS} * 512 )) ${PROG}: ${PROG}.sym ${STRIP} -s ${PROG}.sym \ -R .pdr \ -R .mdebug.abi32 \ -R .ident \ -R .comment \ -o ${.TARGET} @${SIZE} ${.TARGET} @ sz=$$(${TOOL_STAT} -f '%z' ${PROG}); \ if [ "$$sz" -gt "${BOOTXX_MAXSIZE}" ]; then \ echo "### ${PROG} size $$sz is larger than ${BOOTXX_MAXSIZE}" >&2; \ rm ${PROG}; \ ! :; \ else \ : pad to sector boundary; \ pad=$$(( 512 - ( $$sz & 511 ) )); \ [ $$pad = 512 ] || \ dd if=/dev/zero bs=1 count=$$pad >>${PROG} 2>/dev/null; \ echo "${PROG} size $$sz, $$((${BOOTXX_MAXSIZE} - $$sz)) free"; \ fi SRCS= bootxx.S boot1.c STRIPFLAG= # nothing BINDIR=/usr/mdec BINMODE=444 .PATH: ${.CURDIR}/.. CPPFLAGS+= -DBOOTXX # CPPFLAGS+= -D__daddr_t=int32_t CPPFLAGS+= -DBOOTXX_SECTORS=${BOOTXX_SECTORS} CPPFLAGS+= -DPRIMARY_LOAD_ADDRESS=${PRIMARY_LOAD_ADDRESS} CPPFLAGS+= -DSECONDARY_LOAD_ADDRESS=${SECONDARY_LOAD_ADDRESS} CPPFLAGS+= -DXXfs_open=${FS}_open CPPFLAGS+= -DXXfs_close=${FS}_close CPPFLAGS+= -DXXfs_read=${FS}_read CPPFLAGS+= -DXXfs_stat=${FS}_stat CPPFLAGS+= -DFS=${FS} # Make sure we override any optimization options specified by the user COPTS= -Os DBG= CPPFLAGS+= -DNO_LBA_CHECK CPPFLAGS+= -DLIBSA_SINGLE_FILESYSTEM=xxfs \ -DLIBSA_NO_TWIDDLE \ -DLIBSA_NO_FD_CHECKING \ -DLIBSA_NO_RAW_ACCESS \ -DLIBSA_NO_FS_WRITE \ -DLIBSA_NO_FS_SEEK \ -DLIBSA_USE_MEMCPY \ -DLIBSA_USE_MEMSET \ -DLIBSA_SINGLE_DEVICE=blkdev \ -DLIBKERN_OPTIMISE_SPACE \ -D"blkdevioctl(x,y,z)=EINVAL" \ -D"blkdevclose(f)=0" \ -D"devopen(f,n,fl)=(*(fl)=(void *)n,0)" \ -DLIBSA_NO_DISKLABEL_MSGS # -DLIBSA_FS_SINGLECOMPONENT # CPPFLAGS+= -DBOOTXX_RAID1_SUPPORT CLEANFILES+= machine mips ${PROG}.map SAMISCMAKEFLAGS+=SA_USE_LOADFILE=yes .include "../../Makefile.booters" ${PROG}.sym: ${OBJS} ${LIBS} ${LD} -Map ${PROG}.map -N -x \ -Ttext ${PRIMARY_LOAD_ADDRESS} \ ${LDBUG} -e start -o ${.TARGET} ${OBJS} ${LIBS}