]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - stand/i386/isoboot/Makefile
MFC GELI Loader Improvements: r336252, r336254, r336256, r336354,
[FreeBSD/FreeBSD.git] / stand / i386 / isoboot / Makefile
1 # $FreeBSD$
2
3 .include <bsd.init.mk>
4
5 .PATH:          ${BOOTSRC}/i386/boot2 ${BOOTSRC}/i386/gptboot \
6                 ${BOOTSRC}/i386/common ${SASRC}
7
8 FILES=          isoboot
9 MAN=            isoboot.8
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 ISOBOOTSIZE?=   30720
20
21 CFLAGS+=-DBOOTPROG=\"isoboot\" \
22         -O1 \
23         -DSIOPRT=${BOOT_COMCONSOLE_PORT} \
24         -DSIOFMT=${B2SIOFMT} \
25         -DSIOSPD=${BOOT_COMCONSOLE_SPEED} \
26         -I${LDRSRC} \
27         -I${BOOTSRC}/i386/common \
28         -I${BOOTSRC}/i386/boot2 \
29         -Wall -Waggregate-return -Wbad-function-cast -Wno-cast-align \
30         -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \
31         -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \
32         -Winline -Wno-pointer-sign
33
34 CFLAGS.gcc+=    --param max-inline-insns-single=100
35 .if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} <= 40201
36 CFLAGS.gcc+=    -Wno-uninitialized
37 .endif
38 CFLAGS.clang+=  -Oz ${CLANG_OPT_SMALL}
39
40 LD_FLAGS+=${LD_FLAGS_BIN}
41
42 CLEANFILES+=    isoboot
43
44 isoboot: gptldr.bin isoboot.bin ${BTXKERN}
45         btxld -v -E ${ORG2} -f bin -b ${BTXKERN} -l gptldr.bin \
46             -o ${.TARGET} isoboot.bin
47         @set -- `ls -l ${.TARGET}`; x=$$((${ISOBOOTSIZE}-$$5)); \
48             echo "$$x bytes available"; test $$x -ge 0
49
50 CLEANFILES+=    gptldr.bin gptldr.out gptldr.o
51
52 gptldr.bin: gptldr.out
53         ${OBJCOPY} -S -O binary gptldr.out ${.TARGET}
54
55 gptldr.out: gptldr.o
56         ${LD} ${LD_FLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} gptldr.o
57
58 CLEANFILES+=    isoboot.bin isoboot.out isoboot.o sio.o crc32.o drv.o \
59                 cons.o ${OPENCRYPTO_XTS}
60
61 isoboot.bin: isoboot.out
62         ${OBJCOPY} -S -O binary isoboot.out ${.TARGET}
63
64 isoboot.out: ${BTXCRT} isoboot.o sio.o crc32.o drv.o cons.o ${OPENCRYPTO_XTS}
65         ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBSA32}
66
67 .include <bsd.prog.mk>