]> CyberLeo.Net >> Repos - FreeBSD/releng/8.1.git/blob - sys/boot/i386/gptboot/Makefile
Copy stable/8 to releng/8.1 in preparation for 8.1-RC1.
[FreeBSD/releng/8.1.git] / sys / boot / i386 / gptboot / Makefile
1 # $FreeBSD$
2
3 .PATH:          ${.CURDIR}/../boot2
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= -Os \
23         -fno-guess-branch-probability \
24         -fomit-frame-pointer \
25         -fno-unit-at-a-time \
26         -mno-align-long-strings \
27         -mrtd \
28         -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 \
29         -D${GPTBOOT_UFS} \
30         -DSIOPRT=${BOOT_COMCONSOLE_PORT} \
31         -DSIOFMT=${B2SIOFMT} \
32         -DSIOSPD=${BOOT_COMCONSOLE_SPEED} \
33         -I${.CURDIR}/../../common \
34         -I${.CURDIR}/../btx/lib -I. \
35         -I${.CURDIR}/../boot2 \
36         -Wall -Waggregate-return -Wbad-function-cast -Wcast-align \
37         -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \
38         -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \
39         -Winline --param max-inline-insns-single=100
40
41 LDFLAGS=-static -N --gc-sections
42
43 # Pick up ../Makefile.inc early.
44 .include <bsd.init.mk>
45
46 CLEANFILES=     gptboot
47
48 gptboot: gptldr.bin gptboot.bin ${BTXKERN}
49         btxld -v -E ${ORG2} -f bin -b ${BTXKERN} -l gptldr.bin \
50             -o ${.TARGET} gptboot.bin
51
52 CLEANFILES+=    gptldr.bin gptldr.out gptldr.o
53
54 gptldr.bin: gptldr.out
55         objcopy -S -O binary gptldr.out ${.TARGET}
56
57 gptldr.out: gptldr.o
58         ${LD} ${LDFLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} gptldr.o
59
60 CLEANFILES+=    gptboot.bin gptboot.out gptboot.o sio.o
61
62 gptboot.bin: gptboot.out
63         objcopy -S -O binary gptboot.out ${.TARGET}
64
65 gptboot.out: ${BTXCRT} gptboot.o sio.o
66         ${LD} ${LDFLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC}
67
68 gptboot.o: ${.CURDIR}/../../common/ufsread.c
69
70 .if ${MACHINE_ARCH} == "amd64"
71 beforedepend gptboot.o: machine
72 CLEANFILES+=    machine
73 machine:
74         ln -sf ${.CURDIR}/../../../i386/include machine
75 .endif
76
77 .include <bsd.prog.mk>