]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - stand/i386/zfsboot/Makefile
Add two missing eventhandler.h headers
[FreeBSD/FreeBSD.git] / stand / i386 / zfsboot / Makefile
1 # $FreeBSD$
2
3 .include <bsd.init.mk>
4
5 .PATH:          ${BOOTSRC}/i386/boot2 ${BOOTSRC}/i386/common ${SASRC}
6
7 FILES=          zfsboot
8 MAN=            zfsboot.8
9
10 BOOT_COMCONSOLE_PORT?= 0x3f8
11 BOOT_COMCONSOLE_SPEED?= 9600
12 B2SIOFMT?=      0x3
13
14 REL1=   0x700
15 ORG1=   0x7c00
16 ORG2=   0x2000
17
18 CFLAGS+=-DBOOTPROG=\"zfsboot\" \
19         -O1 \
20         -DZFS -DBOOT2 \
21         -DSIOPRT=${BOOT_COMCONSOLE_PORT} \
22         -DSIOFMT=${B2SIOFMT} \
23         -DSIOSPD=${BOOT_COMCONSOLE_SPEED} \
24         -I${LDRSRC} \
25         -I${BOOTSRC}/i386/common \
26         -I${BOOTSRC}/i386 \
27         -I${ZFSSRC} \
28         -I${SYSDIR}/crypto/skein \
29         -I${SYSDIR}/cddl/boot/zfs \
30         -I${BOOTSRC}/i386/boot2 \
31         -Wall -Waggregate-return -Wbad-function-cast -Wno-cast-align \
32         -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \
33         -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings
34
35 CFLAGS.gcc+=    --param max-inline-insns-single=100
36
37 LD_FLAGS+=${LD_FLAGS_BIN}
38
39 CLEANFILES+=    zfsboot
40
41 zfsboot: zfsboot1 zfsboot2
42         cat zfsboot1 zfsboot2 > zfsboot
43
44 CLEANFILES+=    zfsboot1 zfsldr.out zfsldr.o
45
46 zfsboot1: zfsldr.out
47         ${OBJCOPY} -S -O binary zfsldr.out ${.TARGET}
48
49 zfsldr.out: zfsldr.o
50         ${LD} ${LD_FLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} zfsldr.o
51
52 CLEANFILES+=    zfsboot2 zfsboot.ld zfsboot.ldr zfsboot.bin zfsboot.out \
53                 zfsboot.o zfsboot.s zfsboot.s.tmp sio.o cons.o drv.o
54
55 # We currently allow 256k bytes for zfsboot - in practice it could be
56 # any size up to 3.5Mb but keeping it fixed size simplifies zfsldr.
57
58 BOOT2SIZE=      262144
59
60 zfsboot2: zfsboot.ld
61         @set -- `ls -l ${.ALLSRC}`; x=$$((${BOOT2SIZE}-$$5)); \
62             echo "$$x bytes available"; test $$x -ge 0
63         ${DD} if=${.ALLSRC} of=${.TARGET} obs=${BOOT2SIZE} conv=osync
64
65 zfsboot.ld: zfsboot.ldr zfsboot.bin ${BTXKERN}
66         btxld -v -E ${ORG2} -f bin -b ${BTXKERN} -l zfsboot.ldr \
67             -o ${.TARGET} -P 1 zfsboot.bin
68
69 zfsboot.ldr:
70         cp /dev/null ${.TARGET}
71
72 zfsboot.bin: zfsboot.out
73         ${OBJCOPY} -S -O binary zfsboot.out ${.TARGET}
74
75 zfsboot.out: ${BTXCRT} zfsboot.o sio.o drv.o cons.o
76         ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBSA32}
77
78 SRCS=   zfsboot.c
79
80 .include <bsd.prog.mk>