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