]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - sys/boot/i386/gptboot/Makefile
Re-sync loader.mk and ficl.mk to where they should be
[FreeBSD/FreeBSD.git] / sys / boot / i386 / gptboot / Makefile
1 # $FreeBSD$
2
3 HAVE_GELI=              yes
4
5 .include <bsd.init.mk>
6
7 .PATH:          ${BOOTSRC}/i386/boot2 ${BOOTSRC}/i386/common ${SASRC}
8
9 FILES=          gptboot
10 MAN=            gptboot.8
11
12 NM?=            nm
13
14 BOOT_COMCONSOLE_PORT?= 0x3f8
15 BOOT_COMCONSOLE_SPEED?= 9600
16 B2SIOFMT?=      0x3
17
18 REL1=   0x700
19 ORG1=   0x7c00
20 ORG2=   0x0
21
22 # Decide level of UFS support.
23 GPTBOOT_UFS?=   UFS1_AND_UFS2
24 #GPTBOOT_UFS?=  UFS2_ONLY
25 #GPTBOOT_UFS?=  UFS1_ONLY
26
27 CFLAGS+=-DBOOTPROG=\"gptboot\" \
28         -O1 \
29         -DGPT \
30         -D${GPTBOOT_UFS} \
31         -DSIOPRT=${BOOT_COMCONSOLE_PORT} \
32         -DSIOFMT=${B2SIOFMT} \
33         -DSIOSPD=${BOOT_COMCONSOLE_SPEED} \
34         -I${LDRSRC} \
35         -I${BOOTSRC}/i386/common \
36         -I${BTXLIB} \
37         -I${BOOTSRC}/i386/boot2 \
38         -Wall -Waggregate-return -Wbad-function-cast -Wno-cast-align \
39         -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \
40         -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \
41         -Winline -Wno-pointer-sign
42
43 CFLAGS.gcc+=    --param max-inline-insns-single=100
44
45 LD_FLAGS+=${LD_FLAGS_BIN}
46
47 CLEANFILES+=    gptboot
48
49 gptboot: gptldr.bin gptboot.bin ${BTXKERN}
50         btxld -v -E ${ORG2} -f bin -b ${BTXKERN} -l gptldr.bin \
51             -o ${.TARGET} gptboot.bin
52
53 CLEANFILES+=    gptldr.bin gptldr.out gptldr.o
54
55 gptldr.bin: gptldr.out
56         ${OBJCOPY} -S -O binary gptldr.out ${.TARGET}
57
58 gptldr.out: gptldr.o
59         ${LD} ${LD_FLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} gptldr.o
60
61 CLEANFILES+=    gptboot.bin gptboot.out gptboot.o sio.o crc32.o drv.o \
62                 cons.o ${OPENCRYPTO_XTS}
63
64 gptboot.bin: gptboot.out
65         ${OBJCOPY} -S -O binary gptboot.out ${.TARGET}
66
67 gptboot.out: ${BTXCRT} gptboot.o sio.o crc32.o drv.o cons.o ${OPENCRYPTO_XTS}
68         ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBGELIBOOT} ${LIBSA32}
69
70 gptboot.o: ${SASRC}/ufsread.c
71
72 .include <bsd.prog.mk>
73
74 # XXX: clang integrated-as doesn't grok .codeNN directives yet
75 CFLAGS.gptldr.S=        ${CLANG_NO_IAS}