2002-02-15 12:49:20 +00:00
|
|
|
# $FreeBSD$
|
|
|
|
|
2004-02-09 14:17:02 +00:00
|
|
|
PROG= boot1.elf
|
|
|
|
INTERNALPROG=
|
2014-04-13 05:21:56 +00:00
|
|
|
MAN=
|
2012-05-01 17:16:01 +00:00
|
|
|
FILES?= boot1
|
2004-02-11 21:17:04 +00:00
|
|
|
SRCS= _start.s boot1.c
|
2012-05-09 19:08:54 +00:00
|
|
|
CLEANFILES=${FILES} boot1.aout
|
2002-04-01 22:57:51 +00:00
|
|
|
|
2004-02-09 14:17:02 +00:00
|
|
|
BOOTBLOCKBASE= 0x4000
|
2002-02-15 12:49:20 +00:00
|
|
|
|
2014-02-21 21:51:19 +00:00
|
|
|
CFLAGS.clang+=-mcmodel=small
|
|
|
|
CFLAGS.gcc+=-mcmodel=medlow
|
|
|
|
CFLAGS+=-Os -I${.CURDIR}/../../common
|
2010-06-03 17:42:32 +00:00
|
|
|
LDFLAGS=-Ttext ${BOOTBLOCKBASE} -Wl,-N
|
2002-04-01 22:57:51 +00:00
|
|
|
|
2004-02-09 14:17:02 +00:00
|
|
|
# Construct boot1. sunlabel expects it to contain zeroed-out space for the
|
2002-04-01 22:57:51 +00:00
|
|
|
# label, and to be of the correct size.
|
2012-05-09 19:08:54 +00:00
|
|
|
${FILES}: boot1.aout
|
2012-05-01 17:16:01 +00:00
|
|
|
@set -- `ls -l boot1.aout`; x=$$((7680-$$5)); \
|
|
|
|
echo "$$x bytes available"; test $$x -ge 0
|
2002-04-01 22:57:51 +00:00
|
|
|
dd if=/dev/zero of=${.TARGET} bs=512 count=16
|
|
|
|
dd if=boot1.aout of=${.TARGET} bs=512 oseek=1 conv=notrunc
|
2002-02-15 12:49:20 +00:00
|
|
|
|
2004-02-09 14:17:02 +00:00
|
|
|
boot1.aout: boot1.elf
|
|
|
|
elf2aout -o ${.TARGET} ${.ALLSRC}
|
|
|
|
|
|
|
|
boot1.o: ${.CURDIR}/../../common/ufsread.c
|
2002-02-15 12:49:20 +00:00
|
|
|
|
2002-04-01 22:57:51 +00:00
|
|
|
.include <bsd.prog.mk>
|