NetBSD/sys/arch/i386/stand/fatboot/Makefile.fat
2009-03-30 09:22:52 +00:00

54 lines
1.0 KiB
Makefile

# $NetBSD: Makefile.fat,v 1.5 2009/03/30 09:22:52 tsutsui Exp $
S= ${.CURDIR}/../../../../..
PROG?= fatboot
NOMAN= # defined
LIBCRT0= # nothing
LIBCRTBEGIN= # nothing
LIBCRTEND= # nothing
LIBC= # nothing
PIE_CFLAGS=
PIE_LDFLAGS=
PIE_AFLAGS=
.include <bsd.own.mk>
STRIPFLAG= # override
SRCS= fatboot.S
BINDIR= /usr/mdec
BINMODE= 444
.PATH: ${.CURDIR}/..
LDFLAGS+= -nostdlib -Wl,-e,start
CPPFLAGS+= -I. -I${.CURDIR}/../../lib -I${S}
CPPFLAGS+= -DFAT_ENTRY_SIZE=${FAT_ENTRY_SIZE}
.if ${MACHINE_ARCH} == "x86_64"
LDFLAGS+= -Wl,-m,elf_i386
AFLAGS+= -m32
.endif
BUILDSYMLINKS+= $S/arch/i386/include machine \
$S/arch/x86/include x86
DPSRCS+= machine x86
CLEANFILES+= ${PROG}.tmp
${PROG}: ${OBJS}
${_MKTARGET_LINK}
${CC} -o ${PROG}.tmp ${LDFLAGS} -Wl,-Ttext,0x7c00 ${OBJS}
@ set -- $$( ${NM} -t d ${PROG}.tmp | grep '\<pbr_space\>' \
| ${TOOL_SED} 's/^0*//' ); \
echo "#### There are $$1 free bytes in ${PROG}"
${OBJCOPY} -O binary ${PROG}.tmp ${PROG}
rm -f ${PROG}.tmp
.include <bsd.prog.mk>