3 .PATH: ${.CURDIR}/../boot2
9 BOOT_COMCONSOLE_PORT?= 0x3f8
10 BOOT_COMCONSOLE_SPEED?= 9600
17 # Decide level of UFS support.
18 GPTBOOT_UFS?= UFS1_AND_UFS2
19 #GPTBOOT_UFS?= UFS2_ONLY
20 #GPTBOOT_UFS?= UFS1_ONLY
23 -fno-guess-branch-probability \
24 -fomit-frame-pointer \
26 -mno-align-long-strings \
28 -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 \
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
41 LDFLAGS=-static -N --gc-sections
43 # Pick up ../Makefile.inc early.
44 .include <bsd.init.mk>
48 gptboot: gptldr.bin gptboot.bin ${BTXKERN}
49 btxld -v -E ${ORG2} -f bin -b ${BTXKERN} -l gptldr.bin \
50 -o ${.TARGET} gptboot.bin
52 CLEANFILES+= gptldr.bin gptldr.out gptldr.o
54 gptldr.bin: gptldr.out
55 objcopy -S -O binary gptldr.out ${.TARGET}
58 ${LD} ${LDFLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} gptldr.o
60 CLEANFILES+= gptboot.bin gptboot.out gptboot.o sio.o
62 gptboot.bin: gptboot.out
63 objcopy -S -O binary gptboot.out ${.TARGET}
65 gptboot.out: ${BTXCRT} gptboot.o sio.o
66 ${LD} ${LDFLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC}
68 gptboot.o: ${.CURDIR}/../../common/ufsread.c
70 .if ${MACHINE_ARCH} == "amd64"
71 beforedepend gptboot.o: machine
74 ln -sf ${.CURDIR}/../../../i386/include machine
77 .include <bsd.prog.mk>