Changeset View
Changeset View
Standalone View
Standalone View
stand/i386/boot2/Makefile
Show First 20 Lines • Show All 55 Lines • ▼ Show 20 Lines | |||||
boot1: boot1.out | boot1: boot1.out | ||||
${OBJCOPY} -S -O binary boot1.out ${.TARGET} | ${OBJCOPY} -S -O binary boot1.out ${.TARGET} | ||||
boot1.out: boot1.o | boot1.out: boot1.o | ||||
${LD} ${LD_FLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} boot1.o | ${LD} ${LD_FLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} boot1.o | ||||
CLEANFILES+= boot2 boot2.ld boot2.ldr boot2.bin boot2.out boot2.o \ | CLEANFILES+= boot2 boot2.ld boot2.ldr boot2.bin boot2.out boot2.o \ | ||||
boot2.h sio.o | boot2.h sio.o ufsread.o | ||||
BOOT2SIZE= 7680 | BOOT2SIZE= 7680 | ||||
boot2: boot2.ld | boot2: boot2.ld | ||||
@set -- `ls -l ${.ALLSRC}`; x=$$((${BOOT2SIZE}-$$5)); \ | @set -- `ls -l ${.ALLSRC}`; x=$$((${BOOT2SIZE}-$$5)); \ | ||||
echo "$$x bytes available"; test $$x -ge 0 | echo "$$x bytes available"; test $$x -ge 0 | ||||
${DD} if=${.ALLSRC} of=${.TARGET} obs=${BOOT2SIZE} conv=osync | ${DD} if=${.ALLSRC} of=${.TARGET} obs=${BOOT2SIZE} conv=osync | ||||
boot2.ld: boot2.ldr boot2.bin ${BTXKERN} | boot2.ld: boot2.ldr boot2.bin ${BTXKERN} | ||||
btxld -v -E ${ORG2} -f bin -b ${BTXKERN} -l boot2.ldr \ | btxld -v -E ${ORG2} -f bin -b ${BTXKERN} -l boot2.ldr \ | ||||
-o ${.TARGET} -P 1 boot2.bin | -o ${.TARGET} -P 1 boot2.bin | ||||
boot2.ldr: | boot2.ldr: | ||||
${DD} if=/dev/zero of=${.TARGET} bs=512 count=1 | ${DD} if=/dev/zero of=${.TARGET} bs=512 count=1 | ||||
boot2.bin: boot2.out | boot2.bin: boot2.out | ||||
${OBJCOPY} -S -O binary boot2.out ${.TARGET} | ${OBJCOPY} -S -O binary boot2.out ${.TARGET} | ||||
boot2.out: ${BTXCRT} boot2.o sio.o | boot2.out: ${BTXCRT} boot2.o sio.o ufsread.o | ||||
${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} | ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} | ||||
SRCS= boot2.c boot2.h | SRCS= boot2.c boot2.h ufsread.c | ||||
CFLAGS.ufsread.c= -DUFS_SMALL_CGBASE | |||||
.PATH: ${SASRC} | |||||
boot2.h: boot1.out | boot2.h: boot1.out | ||||
${NM} -t d ${.ALLSRC} | awk '/([0-9])+ T xread/ \ | ${NM} -t d ${.ALLSRC} | awk '/([0-9])+ T xread/ \ | ||||
{ x = $$1 - ORG1; \ | { x = $$1 - ORG1; \ | ||||
printf("#define XREADORG %#x\n", REL1 + x) }' \ | printf("#define XREADORG %#x\n", REL1 + x) }' \ | ||||
ORG1=`printf "%d" ${ORG1}` \ | ORG1=`printf "%d" ${ORG1}` \ | ||||
REL1=`printf "%d" ${REL1}` > ${.TARGET} | REL1=`printf "%d" ${REL1}` > ${.TARGET} | ||||
.include <bsd.prog.mk> | .include <bsd.prog.mk> | ||||
# XXX: clang integrated-as doesn't grok .codeNN directives yet | # XXX: clang integrated-as doesn't grok .codeNN directives yet | ||||
CFLAGS.boot1.S= ${CLANG_NO_IAS} | CFLAGS.boot1.S= ${CLANG_NO_IAS} |