]> CyberLeo.Net >> Repos - FreeBSD/releng/10.1.git/blob - sys/boot/i386/gptzfsboot/Makefile
Copy stable/10@r272459 to releng/10.1 as part of
[FreeBSD/releng/10.1.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         -O1 \
21         -DGPT -DBOOT2 \
22         -DSIOPRT=${BOOT_COMCONSOLE_PORT} \
23         -DSIOFMT=${B2SIOFMT} \
24         -DSIOSPD=${BOOT_COMCONSOLE_SPEED} \
25         -I${.CURDIR}/../../common \
26         -I${.CURDIR}/../common \
27         -I${.CURDIR}/../../zfs \
28         -I${.CURDIR}/../../../cddl/boot/zfs \
29         -I${.CURDIR}/../btx/lib -I. \
30         -I${.CURDIR}/../boot2 \
31         -I${.CURDIR}/../../.. \
32         -Wall -Waggregate-return -Wbad-function-cast -Wcast-align \
33         -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \
34         -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \
35         -Winline
36
37 CFLAGS.gcc+=    --param max-inline-insns-single=100
38
39 LD_FLAGS=-static -N --gc-sections
40
41 LIBSTAND=       ${.OBJDIR}/../../libstand32/libstand.a
42
43 # Pick up ../Makefile.inc early.
44 .include <bsd.init.mk>
45
46 CLEANFILES=     gptzfsboot
47
48 gptzfsboot: gptldr.bin gptzfsboot.bin ${BTXKERN}
49         btxld -v -E ${ORG2} -f bin -b ${BTXKERN} -l gptldr.bin \
50             -o ${.TARGET} gptzfsboot.bin
51
52 CLEANFILES+=    gptldr.bin gptldr.out gptldr.o
53
54 gptldr.bin: gptldr.out
55         objcopy -S -O binary gptldr.out ${.TARGET}
56
57 gptldr.out: gptldr.o
58         ${LD} ${LD_FLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} gptldr.o
59
60 CLEANFILES+=    gptzfsboot.bin gptzfsboot.out zfsboot.o sio.o cons.o \
61                 drv.o gpt.o util.o
62
63 gptzfsboot.bin: gptzfsboot.out
64         objcopy -S -O binary gptzfsboot.out ${.TARGET}
65
66 gptzfsboot.out: ${BTXCRT} zfsboot.o sio.o gpt.o drv.o cons.o util.o
67         ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBSTAND}
68
69 zfsboot.o: ${.CURDIR}/../../zfs/zfsimpl.c
70
71 .if ${MACHINE_CPUARCH} == "amd64"
72 beforedepend zfsboot.o: machine
73 CLEANFILES+=    machine
74 machine:
75         ln -sf ${.CURDIR}/../../../i386/include machine
76 .endif
77
78 .include <bsd.prog.mk>
79
80 # XXX: clang integrated-as doesn't grok .codeNN directives yet
81 CFLAGS.gptldr.S=        ${CLANG_NO_IAS}
82 CFLAGS+=                ${CFLAGS.${.IMPSRC:T}}