]> CyberLeo.Net >> Repos - FreeBSD/releng/8.1.git/blob - sys/boot/i386/gptzfsboot/Makefile
Copy stable/8 to releng/8.1 in preparation for 8.1-RC1.
[FreeBSD/releng/8.1.git] / sys / boot / i386 / gptzfsboot / Makefile
1 # $FreeBSD$
2
3 .PATH:          ${.CURDIR}/../boot2 ${.CURDIR}/../gptboot ${.CURDIR}/../zfsboot
4
5 FILES=          gptzfsboot
6
7 NM?=            nm
8
9 BOOT_COMCONSOLE_PORT?= 0x3f8
10 BOOT_COMCONSOLE_SPEED?= 9600
11 B2SIOFMT?=      0x3
12
13 REL1=   0x700
14 ORG1=   0x7c00
15 ORG2=   0x0
16
17 CFLAGS= -Os \
18         -fno-guess-branch-probability \
19         -fomit-frame-pointer \
20         -fno-unit-at-a-time \
21         -mno-align-long-strings \
22         -mrtd \
23         -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 \
24         -DGPT -DBOOT2 \
25         -DSIOPRT=${BOOT_COMCONSOLE_PORT} \
26         -DSIOFMT=${B2SIOFMT} \
27         -DSIOSPD=${BOOT_COMCONSOLE_SPEED} \
28         -I${.CURDIR}/../../common \
29         -I${.CURDIR}/../../zfs \
30         -I${.CURDIR}/../../../cddl/boot/zfs \
31         -I${.CURDIR}/../btx/lib -I. \
32         -I${.CURDIR}/../boot2 \
33         -Wall -Waggregate-return -Wbad-function-cast -Wcast-align \
34         -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \
35         -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \
36         -Winline --param max-inline-insns-single=100
37
38 LDFLAGS=-static -N --gc-sections
39
40 # Pick up ../Makefile.inc early.
41 .include <bsd.init.mk>
42
43 CLEANFILES=     gptzfsboot
44
45 gptzfsboot: gptldr.bin gptzfsboot.bin ${BTXKERN}
46         btxld -v -E ${ORG2} -f bin -b ${BTXKERN} -l gptldr.bin \
47             -o ${.TARGET} gptzfsboot.bin
48
49 CLEANFILES+=    gptldr.bin gptldr.out gptldr.o
50
51 gptldr.bin: gptldr.out
52         objcopy -S -O binary gptldr.out ${.TARGET}
53
54 gptldr.out: gptldr.o
55         ${LD} ${LDFLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} gptldr.o
56
57 CLEANFILES+=    gptzfsboot.bin gptzfsboot.out zfsboot.o sio.o
58
59 gptzfsboot.bin: gptzfsboot.out
60         objcopy -S -O binary gptzfsboot.out ${.TARGET}
61
62 gptzfsboot.out: ${BTXCRT} zfsboot.o sio.o
63         ${LD} ${LDFLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBSTAND}
64
65 zfsboot.o: ${.CURDIR}/../../zfs/zfsimpl.c
66
67 .if ${MACHINE_ARCH} == "amd64"
68 beforedepend zfsboot.o: machine
69 CLEANFILES+=    machine
70 machine:
71         ln -sf ${.CURDIR}/../../../i386/include machine
72 .endif
73
74 .include <bsd.prog.mk>