1 # $NetBSD: Makefile.bootxx,v 1.8 2009/01/06 13:35:30 tsutsui Exp $
13 # XXX SHOULD NOT NEED TO DEFINE THESE!
20 S=${.CURDIR}/../../../../..
22 S_KERN=${S}/lib/libkern
23 S_MACHSA=${S}/arch/atari/stand/libsa
24 S_LIBTOS=${S}/arch/atari/stand/tostools/libtos
26 S_MACHSAOBJ!= cd ${S_MACHSA} && ${PRINTOBJDIR}
28 LIBSA=${S_MACHSAOBJ}/lib/sa/libsa.a
29 LIBKERN=${S_MACHSAOBJ}/lib/kern/libkern.a
31 .include "../../Makefile.booters"
32 .include "../../xxboot/${BTYPE}_LOADADDR"
37 CPPFLAGS+= -I. -I${S_LIBTOS} -I${S_MACHSA} -I${S_KERN} -I${S_SA} -I${S}
38 .if ${OBJECT_FMT} == "ELF"
39 LINKFLAGS= -static -N -e start -Ttext ${LOADADDR}
41 LINKFLAGS= -static -N -Ttext ${LOADADDR}
44 .PATH: ${.CURDIR}/.. ${S_LIBTOS}
47 # Warning: start.S should be the first source!
49 SRCS= start.S bootxx.c filesystem.c
51 LIBS= ${LIBSA} ${LIBKERN}
54 ${INSTALL_DIR} ${DESTDIR}${BINDIR}
56 ${PROG}: ${OBJS} ${LIBS}
58 ${LD} ${LINKFLAGS} -o ${.TARGET}.elf ${OBJS} ${LIBS}
59 ${OBJCOPY} -O binary ${PROG}.elf ${PROG}.bin
61 @len=`${SIZE} ${PROG}.elf | \
62 ${TOOL_AWK} 'NR==2 { print $$1+$$2 }'`; \
63 if [ "$$len" -gt ${BOOTXX_MAXSIZE} ]; then \
64 echo "### ${PROG} text+data size $$len is" \
65 "larger than ${BOOTXX_MAXSIZE}" >&2; \
68 ${TOOL_CAT} ${PROG}.bin /dev/zero | \
69 dd of=${PROG}.tmp bs=1 count=6656 2>/dev/null
70 mv ${PROG}.tmp ${.TARGET}
72 CLEANFILES+= ${PROG}.elf ${PROG}.bin ${PROG}.tmp
74 .include <bsd.prog.mk>