2000-01-27 21:21:01 +00:00
|
|
|
# $FreeBSD$
|
|
|
|
|
|
|
|
MAINTAINER=jhb@FreeBSD.org
|
|
|
|
|
2000-03-28 01:19:53 +00:00
|
|
|
ORG= 0x7c00
|
2000-01-27 21:21:01 +00:00
|
|
|
|
2000-03-28 01:19:53 +00:00
|
|
|
LDR= cdldr
|
|
|
|
BOOT= cdboot
|
|
|
|
PROG= ${BOOT}
|
|
|
|
NOMAN=
|
|
|
|
STRIP=
|
|
|
|
BINDIR?= /boot
|
2000-01-27 21:21:01 +00:00
|
|
|
|
2000-03-28 01:19:53 +00:00
|
|
|
|
|
|
|
.if exists(${.OBJDIR}/../loader)
|
|
|
|
LOADER= ${.OBJDIR}/../loader/loader
|
|
|
|
.else
|
|
|
|
LOADER= ${.CURDIR}/../loader/loader
|
|
|
|
.endif
|
|
|
|
|
|
|
|
${BOOT}: ${LDR} ${LOADER}
|
|
|
|
cat ${LDR} ${LOADER} > ${.TARGET}.tmp
|
|
|
|
dd if=${.TARGET}.tmp of=${.TARGET} obs=2k conv=osync
|
|
|
|
rm ${.TARGET}.tmp
|
|
|
|
|
|
|
|
${LDR}: ${LDR}.o
|
2000-01-27 21:21:01 +00:00
|
|
|
.if ${OBJFORMAT} == aout
|
2000-03-28 01:19:53 +00:00
|
|
|
${LD} -nostdlib -N -s -T ${ORG} -o ${LDR}.out ${LDR}.o
|
|
|
|
dd if=${LDR}.out of=${.TARGET} ibs=32 skip=1
|
2000-01-27 21:21:01 +00:00
|
|
|
.else
|
2000-03-28 01:19:53 +00:00
|
|
|
${LD} -N -e start -Ttext ${ORG} -o ${LDR}.out ${LDR}.o
|
|
|
|
objcopy -S -O binary ${LDR}.out ${.TARGET}
|
2000-01-27 21:21:01 +00:00
|
|
|
.endif
|
|
|
|
|
2000-03-28 01:19:53 +00:00
|
|
|
CLEANFILES+= ${LDR} ${LDR}.out ${LDR}.o ${BOOT}.tmp
|
2000-01-27 21:21:01 +00:00
|
|
|
|
|
|
|
.include <bsd.prog.mk>
|