Makefile revision 218893
1# $FreeBSD: head/sys/boot/i386/gptboot/Makefile 218893 2011-02-20 19:33:47Z dim $ 2 3.PATH: ${.CURDIR}/../boot2 ${.CURDIR}/../common ${.CURDIR}/../../common 4 5FILES= gptboot 6 7NM?= nm 8 9BOOT_COMCONSOLE_PORT?= 0x3f8 10BOOT_COMCONSOLE_SPEED?= 9600 11B2SIOFMT?= 0x3 12 13REL1= 0x700 14ORG1= 0x7c00 15ORG2= 0x0 16 17# Decide level of UFS support. 18GPTBOOT_UFS?= UFS1_AND_UFS2 19#GPTBOOT_UFS?= UFS2_ONLY 20#GPTBOOT_UFS?= UFS1_ONLY 21 22CFLAGS= -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 -DGPT \ 30 -D${GPTBOOT_UFS} \ 31 -DSIOPRT=${BOOT_COMCONSOLE_PORT} \ 32 -DSIOFMT=${B2SIOFMT} \ 33 -DSIOSPD=${BOOT_COMCONSOLE_SPEED} \ 34 -I${.CURDIR}/../../common \ 35 -I${.CURDIR}/../common \ 36 -I${.CURDIR}/../btx/lib -I. \ 37 -I${.CURDIR}/../boot2 \ 38 -I${.CURDIR}/../../.. \ 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.if ${CC:T:Mclang} == "clang" 45# XXX: clang integrated-as doesn't grok .codeNN directives yet 46CFLAGS+= ${.IMPSRC:T:Mgptldr.S:C/^.+$/-no-integrated-as/} 47# XXX: clang integrated-as doesn't grok some 16-bit instructions yet 48CFLAGS+= ${.IMPSRC:T:Msio.S:C/^.+$/-no-integrated-as/} 49.endif 50 51LDFLAGS=-static -N --gc-sections 52 53# Pick up ../Makefile.inc early. 54.include <bsd.init.mk> 55 56CLEANFILES= gptboot 57 58gptboot: gptldr.bin gptboot.bin ${BTXKERN} 59 btxld -v -E ${ORG2} -f bin -b ${BTXKERN} -l gptldr.bin \ 60 -o ${.TARGET} gptboot.bin 61 62CLEANFILES+= gptldr.bin gptldr.out gptldr.o 63 64gptldr.bin: gptldr.out 65 objcopy -S -O binary gptldr.out ${.TARGET} 66 67gptldr.out: gptldr.o 68 ${LD} ${LDFLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} gptldr.o 69 70CLEANFILES+= gptboot.bin gptboot.out gptboot.o sio.o ufsread.o 71 72gptboot.bin: gptboot.out 73 objcopy -S -O binary gptboot.out ${.TARGET} 74 75gptboot.out: ${BTXCRT} gptboot.o sio.o gpt.o crc32.o drv.o cons.o util.o 76 ${LD} ${LDFLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBSTAND} 77 78gptboot.o: ${.CURDIR}/../../common/ufsread.c 79 80.if ${MACHINE_CPUARCH} == "amd64" 81beforedepend gptboot.o: machine 82CLEANFILES+= machine 83machine: 84 ln -sf ${.CURDIR}/../../../i386/include machine 85.endif 86 87.include <bsd.prog.mk> 88