blob: 887e3fe72ee29daaca8d952925c4101a850afc02 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
# $OpenBSD: Makefile,v 1.3 2006/10/11 17:19:06 drahn Exp $
MAN= bootxx.8
.if ${MACHINE} == "landisk"
PROG= bootxx
SRCS= pbr.S bootxx.S boot1.c
LDFLAGS=-nostdlib -Ttext 0x8c201000 -N -x -Bstatic -e start
INSTALL_STRIP=
BOOTXX_SECTORS?= 15
BOOTXX_MAXSIZE?= (( ${BOOTXX_SECTORS} * 512 ))
CPPFLAGS+=-D_STANDALONE
CPPFLAGS+=-nostdinc -I${.OBJDIR} -I${.CURDIR}/.. -I${.CURDIR}/../../../..
CPPFLAGS+=-DLOADADDRESS=0x8ff00000 -DBOOTXX_SECTORS=${BOOTXX_SECTORS}
CFLAGS+=-m4-nofpu
S= ${.CURDIR}/../../../..
SAREL=
.include "${S}/lib/libsa/Makefile.inc"
DPADD+= $(SALIB)
LDADD+= $(SALIB)
KERN_AS?= library
.include "${S}/lib/libkern/Makefile.inc"
DPADD+= $(KERNLIB)
LDADD+= $(KERNLIB)
LIBGCC!=${CC} -print-libgcc-file-name
LDADD+= $(LIBGCC)
${PROG}: ${OBJS} ${DPADD}
${LD} -o ${PROG}.sym ${LDFLAGS} \
-Map ${PROG}.map -cref ${OBJS} ${LDADD}
${OBJCOPY} -O binary ${PROG}.sym ${PROG}
@ sz=$$(ls -ln ${PROG} | tr -s ' ' | cut -d' ' -f5); \
if [ "$$sz" -gt "$$${BOOTXX_MAXSIZE}" ]; then \
echo "### ${PROG} size $$sz is larger than ${BOOTXX_MAXSIZE}" >&2 \
rm -f ${PROG}; \
! :; \
else \
: pad to sector boundary; \
pad=$$(( 512 - ( $$sz & 511 ) )); \
[ $$pad = 512 ] || \
dd if=/dev/zero bs=1 count=$$pad >>${PROG} 2>/dev/null; \
echo "${PROG} size $$sz, $$((${BOOTXX_MAXSIZE} - $$sz)) free"; \
fi
.else
NOPROG=
.endif
.include <bsd.prog.mk>
|