9ebf93dc6d
Linux kernel image, and is designed to be dropped into a Linux system and booted via LILO. Once booted, the user is greeted by the FreeBSD loader. This still isn't quite complete, as the the root= specification from LILO isn't currently passed to the loader yet.
52 lines
1.2 KiB
Makefile
52 lines
1.2 KiB
Makefile
# $FreeBSD$
|
|
|
|
ORG= 0x0
|
|
|
|
LDR= liloldr
|
|
BSECT= lilobsect
|
|
BOOT= liloboot
|
|
PROG= ${BOOT}
|
|
MAN8= ${BOOT}.8
|
|
STRIP=
|
|
BINDIR?= /boot
|
|
|
|
.if exists(${.OBJDIR}/../loader)
|
|
LOADER= ${.OBJDIR}/../loader/loader
|
|
.else
|
|
LOADER= ${.CURDIR}/../loader/loader
|
|
.endif
|
|
|
|
LOADER_SIZE != wc -c ${LOADER} | awk '{print int(($$1 + 15) / 16)}'
|
|
AFLAGS= --defsym LOADER_SIZE=${LOADER_SIZE}
|
|
|
|
${BOOT}: ${BSECT} ${LDR} ${LOADER}
|
|
cat ${BSECT} ${LDR} ${LOADER} > ${.TARGET}.tmp
|
|
dd if=${.TARGET}.tmp of=${.TARGET} obs=2k conv=osync
|
|
rm ${.TARGET}.tmp
|
|
|
|
${LDR}: ${LDR}.o
|
|
.if ${OBJFORMAT} == aout
|
|
${LD} -nostdlib -N -s -T ${ORG} -o ${LDR}.out ${LDR}.o
|
|
dd if=${LDR}.out of=${.TARGET} ibs=32 skip=1
|
|
.else
|
|
${LD} -N -e start -Ttext ${ORG} -o ${LDR}.out ${LDR}.o
|
|
objcopy -S -O binary ${LDR}.out ${.TARGET}
|
|
.endif
|
|
|
|
${BSECT}: ${BSECT}.o
|
|
.if ${OBJFORMAT} == aout
|
|
${LD} -nostdlib -N -s -T ${ORG} -o ${BSECT}.out ${BSECT}.o
|
|
dd if=${BSECT}.out of=${.TARGET} ibs=32 skip=1
|
|
.else
|
|
${LD} -N -e start -Ttext ${ORG} -o ${BSECT}.out ${BSECT}.o
|
|
objcopy -S -O binary ${BSECT}.out ${.TARGET}
|
|
.endif
|
|
|
|
|
|
${BSECT}.o: ${BSECT}.s ${LOADER}
|
|
|
|
CLEANFILES+= ${LDR} ${LDR}.out ${LDR}.o \
|
|
${BSECT} ${BSECT}.out ${BSECT}.o ${BOOT}.tmp
|
|
|
|
.include <bsd.prog.mk>
|