opnsense-src/sys/boot/sparc64/boot1/Makefile
Enji Cooper c20d3baeb0 Don't hardcode input files for stage 1/2 bootloaders; use .ALLSRC instead
This is a better pattern to follow when creating the bootloaders and doing
the relevant space checks to make sure that the sizes aren't exceeded (and
thus, copy-pasting is a bit less error prone).

MFC after:	3 days
Sponsored by:	Dell EMC Isilon
2017-03-28 21:35:18 +00:00

30 lines
747 B
Makefile

# $FreeBSD$
PROG= boot1.elf
INTERNALPROG=
MAN=
FILES?= boot1
SRCS= _start.s boot1.c
CLEANFILES=${FILES} boot1.aout
BOOTBLOCKBASE= 0x4000
CFLAGS.clang+=-mcmodel=small
CFLAGS.gcc+=-mcmodel=medlow
CFLAGS+=-Os -I${.CURDIR}/../../common
LDFLAGS=-Ttext ${BOOTBLOCKBASE} -Wl,-N
# Construct boot1. sunlabel expects it to contain zeroed-out space for the
# label, and to be of the correct size.
${FILES}: boot1.aout
@set -- `ls -l ${.ALLSRC}`; x=$$((7680-$$5)); \
echo "$$x bytes available"; test $$x -ge 0
${DD} if=/dev/zero of=${.TARGET} bs=512 count=16
${DD} if=${.ALLSRC} of=${.TARGET} bs=512 oseek=1 conv=notrunc
boot1.aout: boot1.elf
elf2aout -o ${.TARGET} ${.ALLSRC}
boot1.o: ${.CURDIR}/../../common/ufsread.c
.include <bsd.prog.mk>