Makefile revision 259065
1238789Sandrew# $FreeBSD: releng/10.0/sys/boot/i386/gptboot/Makefile 252492 2013-07-01 22:38:36Z wblock $ 2238789Sandrew 3238789Sandrew.PATH: ${.CURDIR}/../boot2 ${.CURDIR}/../common ${.CURDIR}/../../common 4238789Sandrew 5238789SandrewFILES= gptboot 6238789SandrewMAN= gptboot.8 7238789Sandrew 8238789SandrewNM?= nm 9238789Sandrew 10238789SandrewBOOT_COMCONSOLE_PORT?= 0x3f8 11238789SandrewBOOT_COMCONSOLE_SPEED?= 9600 12238789SandrewB2SIOFMT?= 0x3 13 14REL1= 0x700 15ORG1= 0x7c00 16ORG2= 0x0 17 18# Decide level of UFS support. 19GPTBOOT_UFS?= UFS1_AND_UFS2 20#GPTBOOT_UFS?= UFS2_ONLY 21#GPTBOOT_UFS?= UFS1_ONLY 22 23CFLAGS= -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${.CURDIR}/../../common \ 31 -I${.CURDIR}/../common \ 32 -I${.CURDIR}/../btx/lib -I. \ 33 -I${.CURDIR}/../boot2 \ 34 -I${.CURDIR}/../../.. \ 35 -Wall -Waggregate-return -Wbad-function-cast -Wcast-align \ 36 -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \ 37 -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \ 38 -Winline --param max-inline-insns-single=100 39 40LDFLAGS=-static -N --gc-sections 41 42# Pick up ../Makefile.inc early. 43.include <bsd.init.mk> 44 45CLEANFILES= gptboot 46 47gptboot: gptldr.bin gptboot.bin ${BTXKERN} 48 btxld -v -E ${ORG2} -f bin -b ${BTXKERN} -l gptldr.bin \ 49 -o ${.TARGET} gptboot.bin 50 51CLEANFILES+= gptldr.bin gptldr.out gptldr.o 52 53gptldr.bin: gptldr.out 54 objcopy -S -O binary gptldr.out ${.TARGET} 55 56gptldr.out: gptldr.o 57 ${LD} ${LDFLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} gptldr.o 58 59CLEANFILES+= gptboot.bin gptboot.out gptboot.o sio.o gpt.o crc32.o drv.o \ 60 cons.o util.o 61 62gptboot.bin: gptboot.out 63 objcopy -S -O binary gptboot.out ${.TARGET} 64 65gptboot.out: ${BTXCRT} gptboot.o sio.o gpt.o crc32.o drv.o cons.o util.o 66 ${LD} ${LDFLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBSTAND} 67 68gptboot.o: ${.CURDIR}/../../common/ufsread.c 69 70.if ${MACHINE_CPUARCH} == "amd64" 71beforedepend gptboot.o: machine 72CLEANFILES+= machine 73machine: 74 ln -sf ${.CURDIR}/../../../i386/include machine 75.endif 76 77.include <bsd.prog.mk> 78 79# XXX: clang integrated-as doesn't grok .codeNN directives yet 80CFLAGS.gptldr.S= ${CLANG_NO_IAS} 81CFLAGS+= ${CFLAGS.${.IMPSRC:T}} 82