minix/sys/arch/i386/stand/mbr/Makefile.mbr
Ben Gras 2fe8fb192f Full switch to clang/ELF. Drop ack. Simplify.
There is important information about booting non-ack images in
docs/UPDATING. ack/aout-format images can't be built any more, and
booting clang/ELF-format ones is a little different. Updating to the
new boot monitor is recommended.

Changes in this commit:

	. drop boot monitor -> allowing dropping ack support
	. facility to copy ELF boot files to /boot so that old boot monitor
	  can still boot fairly easily, see UPDATING
	. no more ack-format libraries -> single-case libraries
	. some cleanup of OBJECT_FMT, COMPILER_TYPE, etc cases
	. drop several ack toolchain commands, but not all support
	  commands (e.g. aal is gone but acksize is not yet).
	. a few libc files moved to netbsd libc dir
	. new /bin/date as minix date used code in libc/
	. test compile fix
	. harmonize includes
	. /usr/lib is no longer special: without ack, /usr/lib plays no
	  kind of special bootstrapping role any more and bootstrapping
	  is done exclusively through packages, so releases depend even
	  less on the state of the machine making them now.
	. rename nbsd_lib* to lib*
	. reduce mtree
2012-02-14 14:52:02 +01:00

59 lines
1.2 KiB
Text

# $NetBSD: Makefile.mbr,v 1.17 2009/11/20 17:28:19 dsl Exp $
NOMAN= # defined
LIBCRT0= # nothing
LIBCRTBEGIN= # nothing
LIBCRTEND= # nothing
LIBC= # nothing
PIE_CFLAGS=
PIE_LDFLAGS=
PIE_AFLAGS=
.include <bsd.own.mk>
STRIPFLAG= # override
TOOL_SED?= sed
NM?= nm
SRCS?= mbr.S
BINDIR= /usr/mdec
BINMODE= 444
.PATH: ${.CURDIR}/..
LOADADDR= 0x8800
LDFLAGS+= -nostdlib -Wl,-e,start
CPPFLAGS+= -I. -I${.CURDIR}/../../lib -DLOADADDR=${LOADADDR}
.if ${MACHINE_ARCH} == "x86_64"
LDFLAGS+= -Wl,-m,elf_i386
AFLAGS+= -m32
.endif
AFLAGS+= "-Wa,--divide"
# 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
CLEANFILES+= ${PROG}.tmp
${PROG}: ${OBJS}
${_MKTARGET_LINK}
${CC} -o ${PROG}.tmp ${LDFLAGS} -Wl,-Ttext,${LOADADDR} ${OBJS}
@ set -- $$( ${NM} -t d ${PROG}.tmp | grep 'mbr_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>