]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - stand/i386/gptboot/Makefile
loader: remove libsa/crc32.c and use version from zlib
[FreeBSD/FreeBSD.git] / stand / i386 / gptboot / Makefile
1 # $FreeBSD$
2
3 .include <bsd.init.mk>
4
5 .PATH:          ${BOOTSRC}/i386/boot2 ${BOOTSRC}/i386/common ${SASRC}
6
7 FILES=          gptboot
8 MAN=            gptboot.8
9
10 BOOT_COMCONSOLE_PORT?= 0x3f8
11 BOOT_COMCONSOLE_SPEED?= 9600
12 B2SIOFMT?=      0x3
13
14 REL1=   0x700
15 ORG1=   0x7c00
16 ORG2=   0x0
17
18 # Decide level of UFS support.
19 GPTBOOT_UFS?=   UFS1_AND_UFS2
20 #GPTBOOT_UFS?=  UFS2_ONLY
21 #GPTBOOT_UFS?=  UFS1_ONLY
22
23 CFLAGS+=-DBOOTPROG=\"gptboot\" \
24         -O1 \
25         -DGPT \
26         -D${GPTBOOT_UFS} \
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         -DHAVE_MEMCPY -I${SRCTOP}/sys/contrib/zlib \
34         -Wall -Waggregate-return -Wbad-function-cast -Wno-cast-align \
35         -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \
36         -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \
37         -Wno-pointer-sign
38
39 CFLAGS.gcc+=    --param max-inline-insns-single=100
40
41 LD_FLAGS+=${LD_FLAGS_BIN}
42
43 CLEANFILES+=    gptboot
44
45 gptboot: gptldr.bin gptboot.bin ${BTXKERN}
46         btxld -v -E ${ORG2} -f bin -b ${BTXKERN} -l gptldr.bin \
47             -o ${.TARGET} gptboot.bin
48
49 CLEANFILES+=    gptldr.bin gptldr.out gptldr.o
50
51 gptldr.bin: gptldr.out
52         ${OBJCOPY} -S -O binary gptldr.out ${.TARGET}
53
54 gptldr.out: gptldr.o
55         ${LD} ${LD_FLAGS} -e start --defsym ORG=${ORG1} -T ${LDSCRIPT} -o ${.TARGET} gptldr.o
56
57 CLEANFILES+=    gptboot.bin gptboot.out gptboot.o sio.o crc32.o drv.o \
58                 cons.o ${OPENCRYPTO_XTS}
59
60 gptboot.bin: gptboot.out
61         ${OBJCOPY} -S -O binary gptboot.out ${.TARGET}
62
63 gptboot.out: ${BTXCRT} gptboot.o sio.o crc32.o drv.o cons.o ${OPENCRYPTO_XTS}
64         ${LD} ${LD_FLAGS} --defsym ORG=${ORG2} -T ${LDSCRIPT} -o ${.TARGET} ${.ALLSRC} ${LIBSA32}
65
66 .include <bsd.prog.mk>