1# $FreeBSD: stable/11/stand/sparc64/boot1/Makefile 329183 2018-02-12 20:51:28Z kevans $
2
3.include <bsd.init.mk>
4
5PROG=	boot1.elf
6INTERNALPROG=
7FILES?=	boot1
8SRCS=	_start.s boot1.c
9CLEANFILES+=${FILES} boot1.aout
10
11BOOTBLOCKBASE= 0x4000
12
13CFLAGS.clang+=-mcmodel=small
14CFLAGS.gcc+=-mcmodel=medlow
15CFLAGS+=-Os -I${LDRSRC}
16LDFLAGS+=-Ttext ${BOOTBLOCKBASE} -Wl,-N
17
18# Construct boot1. sunlabel expects it to contain zeroed-out space for the
19# label, and to be of the correct size.
20${FILES}: boot1.aout
21	@set -- `ls -l ${.ALLSRC}`; x=$$((7680-$$5)); \
22	    echo "$$x bytes available"; test $$x -ge 0
23	${DD} if=/dev/zero of=${.TARGET} bs=512 count=16
24	${DD} if=${.ALLSRC} of=${.TARGET} bs=512 oseek=1 conv=notrunc
25
26boot1.aout: boot1.elf
27	elf2aout -o ${.TARGET} ${.ALLSRC}
28
29.include <bsd.prog.mk>
30