minix/sys/arch/i386/stand/mbr/Makefile.mbr

60 lines
1.2 KiB
Text
Raw Normal View History

2012-01-10 17:43:33 +01:00
# $NetBSD: Makefile.mbr,v 1.17 2009/11/20 17:28:19 dsl Exp $
2012-01-10 11:01:31 +01:00
NOMAN= # defined
LIBCRT0= # nothing
LIBCRTBEGIN= # nothing
LIBCRTEND= # nothing
LIBC= # nothing
PIE_CFLAGS=
PIE_LDFLAGS=
PIE_AFLAGS=
.include <bsd.own.mk>
STRIPFLAG= # override
2012-01-10 17:43:33 +01:00
TOOL_SED?= sed
NM?= nm
2012-01-10 11:01:31 +01:00
SRCS?= mbr.S
BINDIR= /usr/mdec
BINMODE= 444
.PATH: ${.CURDIR}/..
2012-01-10 17:43:33 +01:00
LOADADDR= 0x8800
2012-01-10 11:01:31 +01:00
LDFLAGS+= -nostdlib -Wl,-e,start
2012-01-10 17:43:33 +01:00
CPPFLAGS+= -I. -I${.CURDIR}/../../lib -DLOADADDR=${LOADADDR}
2012-01-10 11:01:31 +01:00
.if ${MACHINE_ARCH} == "x86_64"
LDFLAGS+= -Wl,-m,elf_i386
AFLAGS+= -m32
.endif
2012-01-10 17:43:33 +01:00
AFLAGS+= "-Wa,--divide"
2012-01-10 11:01:31 +01:00
2012-01-10 17:43:33 +01:00
# NetBSD can be compiled from a foreign host, MINIX do not. So commented out.
# Make sys/ a local thing for benefit of cross-compilers
#S= ${.CURDIR}/../../../../..
#CPPFLAGS+= -I${S}
# And same for machine/; need a bit more work because of symlink
#BUILDSYMLINKS+= $S/arch/i386/include machine \
# $S/arch/x86/include x86
#DPSRCS+= machine x86
2012-01-10 11:01:31 +01:00
CLEANFILES+= ${PROG}.tmp
${PROG}: ${OBJS}
${_MKTARGET_LINK}
${CC} -o ${PROG}.tmp ${LDFLAGS} -Wl,-Ttext,${LOADADDR} ${OBJS}
2012-01-10 17:43:33 +01:00
@ set -- $$( ${NM} -t d ${PROG}.tmp | grep 'mbr_space' \
2012-01-10 11:01:31 +01:00
| ${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>