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