2000-03-28 01:19:53 +00:00
|
|
|
# $FreeBSD$
|
|
|
|
|
|
|
|
MAINTAINER=jhb@FreeBSD.org
|
|
|
|
|
|
|
|
ORG= 0x7c00
|
|
|
|
|
|
|
|
LDR= pxeldr
|
|
|
|
BOOT= pxeboot
|
2002-08-29 23:37:44 +00:00
|
|
|
LOADER= loader
|
2000-03-28 01:19:53 +00:00
|
|
|
PROG= ${BOOT}
|
2001-03-27 11:59:22 +00:00
|
|
|
MAN= ${BOOT}.8
|
2000-03-28 01:19:53 +00:00
|
|
|
STRIP=
|
|
|
|
BINDIR?= /boot
|
2000-11-30 14:55:10 +00:00
|
|
|
M4?= m4
|
2000-03-28 01:19:53 +00:00
|
|
|
|
2000-11-30 14:55:10 +00:00
|
|
|
.if defined(BOOT_PXELDR_PROBE_KEYBOARD)
|
|
|
|
M4FLAGS+= -DPROBE_KEYBOARD
|
|
|
|
.endif
|
2000-03-28 01:19:53 +00:00
|
|
|
|
2003-09-03 08:12:20 +00:00
|
|
|
.if defined(BOOT_PXELDR_ALWAYS_SERIAL)
|
|
|
|
M4FLAGS+= -DALWAYS_SERIAL
|
|
|
|
.endif
|
|
|
|
|
|
|
|
|
2000-03-28 01:19:53 +00:00
|
|
|
.if exists(${.OBJDIR}/../loader)
|
2002-08-29 23:37:44 +00:00
|
|
|
LOADERBIN= ${.OBJDIR}/../loader/loader.bin
|
2000-03-28 01:19:53 +00:00
|
|
|
.else
|
2002-08-29 23:37:44 +00:00
|
|
|
LOADERBIN= ${.CURDIR}/../loader/loader.bin
|
2000-03-28 01:19:53 +00:00
|
|
|
.endif
|
|
|
|
|
2002-08-29 23:37:44 +00:00
|
|
|
# BTX components
|
|
|
|
.if exists(${.OBJDIR}/../btx)
|
|
|
|
BTXDIR= ${.OBJDIR}/../btx
|
|
|
|
.else
|
|
|
|
BTXDIR= ${.CURDIR}/../btx
|
|
|
|
.endif
|
|
|
|
BTXLDR= ${BTXDIR}/btxldr/btxldr
|
|
|
|
BTXKERN= ${BTXDIR}/btx/btx
|
|
|
|
BTXCRT= ${BTXDIR}/lib/crt0.o
|
|
|
|
|
2000-03-28 01:19:53 +00:00
|
|
|
${BOOT}: ${LDR} ${LOADER}
|
|
|
|
cat ${LDR} ${LOADER} > ${.TARGET}.tmp
|
|
|
|
dd if=${.TARGET}.tmp of=${.TARGET} obs=2k conv=osync
|
|
|
|
rm ${.TARGET}.tmp
|
|
|
|
|
2002-08-29 23:37:44 +00:00
|
|
|
${LOADER}: ${LOADERBIN} ${BTXLDR} ${BTXKERN} ${BTXCRT}
|
|
|
|
btxld -v -f aout -e ${LOADER_ADDRESS} -o ${.TARGET} -l ${BTXLDR} \
|
|
|
|
-b ${BTXKERN} ${LOADERBIN}
|
|
|
|
|
2000-03-28 01:19:53 +00:00
|
|
|
${LDR}: ${LDR}.o
|
|
|
|
${LD} -N -e start -Ttext ${ORG} -o ${LDR}.out ${LDR}.o
|
|
|
|
objcopy -S -O binary ${LDR}.out ${.TARGET}
|
|
|
|
|
2000-11-30 14:55:10 +00:00
|
|
|
${LDR}.o: ${LDR}.s
|
|
|
|
(cd ${.CURDIR}; ${M4} ${M4FLAGS} ${LDR}.s) | \
|
|
|
|
${AS} ${AFLAGS} -o ${.TARGET}
|
|
|
|
|
2002-08-29 23:37:44 +00:00
|
|
|
CLEANFILES+= ${LDR} ${LDR}.out ${LDR}.o ${BOOT}.tmp ${LOADER}
|
2000-03-28 01:19:53 +00:00
|
|
|
|
|
|
|
.include <bsd.prog.mk>
|