]> CyberLeo.Net >> Repos - FreeBSD/releng/8.2.git/blob - sys/boot/i386/gptboot/Makefile
Copy stable/8 to releng/8.2 in preparation for FreeBSD-8.2 release.
[FreeBSD/releng/8.2.git] / sys / boot / i386 / gptboot / Makefile
1 # $FreeBSD$
2
3 .PATH:          ${.CURDIR}/../boot2 ${.CURDIR}/../common ${.CURDIR}/../../common
4
5 FILES=          gptboot
6
7 NM?=            nm
8
9 BOOT_COMCONSOLE_PORT?= 0x3f8
10 BOOT_COMCONSOLE_SPEED?= 9600
11 B2SIOFMT?=      0x3
12
13 REL1=   0x700
14 ORG1=   0x7c00
15 ORG2=   0x0
16
17 # Decide level of UFS support.
18 GPTBOOT_UFS?=   UFS1_AND_UFS2
19 #GPTBOOT_UFS?=  UFS2_ONLY
20 #GPTBOOT_UFS?=  UFS1_ONLY
21
22 CFLAGS= -DBOOTPROG=\"gptboot\" \
23         -Os \
24         -fno-guess-branch-probability \
25         -fomit-frame-pointer \
26         -fno-unit-at-a-time \
27         -mno-align-long-strings \
28         -mrtd \
29         -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 \
30         -DGPT \
31         -D${GPTBOOT_UFS} \
32         -DSIOPRT=${BOOT_COMCONSOLE_PORT} \
33         -DSIOFMT=${B2SIOFMT} \
34         -DSIOSPD=${BOOT_COMCONSOLE_SPEED} \
35         -I${.CURDIR}/../../common \
36         -I${.CURDIR}/../common \
37         -I${.CURDIR}/../btx/lib -I. \
38         -I${.CURDIR}/../boot2 \
39         -Wall -Waggregate-return -Wbad-function-cast -Wcast-align \
40         -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \
41         -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \
42         -Winline --param max-inline-insns-single=100
43
44 LDFLAGS=-static -N --gc-sections
45
46 # Pick up ../Makefile.inc early.
47 .include <bsd.init.mk>
48
49 CLEANFILES=     gptboot
50
51 gptboot: gptldr.bin gptboot.bin ${BTXKERN}
52         btxld -v -E ${ORG2} -f bin -b ${BTXKERN} -l gptldr.bin \
53             -o ${.TARGET} gptboot.bin
54
55 CLEANFILES+=    gptldr.bin gptldr.out gptldr.o
56
57 gptldr.bin: gptldr.out
58         objcopy -S -O binary gptldr.out ${.TARGET}
59
60 gptldr.out: gptldr.o
61         ${LD} ${LDFLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} gptldr.o
62
63 CLEANFILES+=    gptboot.bin gptboot.out gptboot.o sio.o ufsread.o
64
65 gptboot.bin: gptboot.out
66         objcopy -S -O binary gptboot.out ${.TARGET}
67
68 gptboot.out: ${BTXCRT} gptboot.o sio.o gpt.o crc32.o drv.o cons.o util.o
69         ${LD} ${LDFLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBSTAND}
70
71 gptboot.o: ${.CURDIR}/../../common/ufsread.c
72
73 .if ${MACHINE_ARCH} == "amd64"
74 beforedepend gptboot.o: machine
75 CLEANFILES+=    machine
76 machine:
77         ln -sf ${.CURDIR}/../../../i386/include machine
78 .endif
79
80 .include <bsd.prog.mk>