1 # $NetBSD: Makefile.mbr,v 1.16 2009/03/30 09:22:52 tsutsui Exp $
3 S= ${.CURDIR}/../../../../..
27 LDFLAGS+= -nostdlib -Wl,-e,start
28 CPPFLAGS+= -I. -I${.CURDIR}/../../lib -I${S}
30 .if ${MACHINE_ARCH} == "x86_64"
31 LDFLAGS+= -Wl,-m,elf_i386
35 BUILDSYMLINKS+= $S/arch/i386/include machine \
36 $S/arch/x86/include x86
40 CLEANFILES+= ${PROG}.tmp
46 ${CC} -o ${PROG}.tmp ${LDFLAGS} -Wl,-Ttext,${LOADADDR} ${OBJS}
47 @ set -- $$( ${NM} -t d ${PROG}.tmp | grep '\<mbr_space\>' \
48 | ${TOOL_SED} 's/^0*//' ); \
49 echo "#### There are $$1 free bytes in ${PROG}"
50 ${OBJCOPY} -O binary ${PROG}.tmp ${PROG}
53 .include <bsd.prog.mk>