NetBSD/sys/arch/atari/stand/bootxx/Makefile.bootxx
tsutsui d008724eb5 Switch atari standalone bootloaders to using MI libsa and libkern.
Tested by David Ross on port-atari@. Thanks!
2009-03-31 11:42:07 +00:00

75 lines
1.6 KiB
Makefile

# $NetBSD: Makefile.bootxx,v 1.9 2009/03/31 11:42:07 tsutsui Exp $
NOMAN= # defined
# for OBJECT_FMT
.include <bsd.own.mk>
PROG= bootxx
STRIPFLAG=
BINMODE=${NONBINMODE}
# XXX SHOULD NOT NEED TO DEFINE THESE!
LIBCRT0=
LIBC=
LIBCRTBEGIN=
LIBCRTEND=
# logically src/sys
S=${.CURDIR}/../../../../..
S_SA=${S}/lib/libsa
S_KERN=${S}/lib/libkern
S_MACHSA=${S}/arch/atari/stand/libsa
S_LIBTOS=${S}/arch/atari/stand/tostools/libtos
S_MACHSAOBJ!= cd ${S_MACHSA} && ${PRINTOBJDIR}
LIBSA=${S_MACHSAOBJ}/lib/sa/libsa.a
LIBKERN=${S_MACHSAOBJ}/lib/kern/libkern.a
.include "../../Makefile.booters"
.include "../../xxboot/${BTYPE}_LOADADDR"
BOOTXX_MAXSIZE= 6656
CPPFLAGS+= -I. -I${S_LIBTOS} -I${S_MACHSA} -I${S_KERN} -I${S_SA} -I${S}
.if ${OBJECT_FMT} == "ELF"
LINKFLAGS= -static -N -e start -Ttext ${LOADADDR}
.else
LINKFLAGS= -static -N -Ttext ${LOADADDR}
.endif
.PATH: ${.CURDIR}/.. ${S_LIBTOS}
#
# Warning: start.S should be the first source!
#
SRCS= start.S bootxx.c filesystem.c
LIBS= ${LIBSA} ${LIBKERN}
beforeinstall:
${INSTALL_DIR} ${DESTDIR}${BINDIR}
${PROG}: ${OBJS} ${LIBS}
${_MKTARGET_LINK}
${LD} ${LINKFLAGS} -o ${.TARGET}.elf ${OBJS} ${LIBS}
${OBJCOPY} -O binary ${PROG}.elf ${PROG}.bin
${SIZE} ${PROG}.elf
@len=`${SIZE} ${PROG}.elf | \
${TOOL_AWK} 'NR==2 { print $$1+$$2 }'`; \
if [ "$$len" -gt ${BOOTXX_MAXSIZE} ]; then \
echo "### ${PROG} text+data size $$len is" \
"larger than ${BOOTXX_MAXSIZE}" >&2; \
exit 1; \
fi;
${TOOL_CAT} ${PROG}.bin /dev/zero | \
dd of=${PROG}.tmp bs=1 count=6656 2>/dev/null
mv ${PROG}.tmp ${.TARGET}
CLEANFILES+= ${PROG}.elf ${PROG}.bin ${PROG}.tmp
.include <bsd.prog.mk>