freebsd-dev/sys/boot/i386/pxeldr/Makefile
Ruslan Ermilov a4a62f5d1f First round of cleanups to sys/boot/ makefiles:
- do not use PROG for what's not a real C program,
- use sys.mk transformation rules where possible,
- only create the "machine" symlink on AMD64,
- removed MAINTAINER lines in individual makefiles,
- added the LIBSTAND defitinion to <bsd.libnames.mk>,
- somewhat better contents in .depend files.

Tested on:	i386, amd64
Prodded by:	bde
2004-02-06 21:58:32 +00:00

56 lines
1.1 KiB
Makefile

# $FreeBSD$
# Pick up ../Makefile.inc early.
.include <bsd.init.mk>
FILES= ${BOOT}
MAN= ${BOOT}.8
CLEANFILES= ${BOOT}
BOOT= pxeboot
LDR= pxeldr
ORG= 0x7c00
LOADER= loader
M4?= m4
.if defined(BOOT_PXELDR_PROBE_KEYBOARD)
M4FLAGS+= -DPROBE_KEYBOARD
.endif
.if defined(BOOT_PXELDR_ALWAYS_SERIAL)
M4FLAGS+= -DALWAYS_SERIAL
.endif
.if exists(${.OBJDIR}/../loader)
LOADERBIN= ${.OBJDIR}/../loader/loader.bin
.else
LOADERBIN= ${.CURDIR}/../loader/loader.bin
.endif
CLEANFILES+= ${BOOT}.tmp
${BOOT}: ${LDR} ${LOADER}
cat ${LDR} ${LOADER} > ${.TARGET}.tmp
dd if=${.TARGET}.tmp of=${.TARGET} obs=2k conv=osync
rm ${.TARGET}.tmp
CLEANFILES+= ${LDR} ${LDR}.out ${LDR}.o
${LDR}: ${LDR}.out
objcopy -S -O binary ${LDR}.out ${.TARGET}
${LDR}.out: ${LDR}.o
${LD} -N -e start -Ttext ${ORG} -o ${.TARGET} ${LDR}.o
${LDR}.o: ${LDR}.s
(cd ${.CURDIR}; ${M4} ${M4FLAGS} ${LDR}.s) | \
${AS} ${AFLAGS} -o ${.TARGET}
CLEANFILES+= ${LOADER}
${LOADER}: ${LOADERBIN} ${BTXLDR} ${BTXKERN}
btxld -v -f aout -e ${LOADER_ADDRESS} -o ${.TARGET} -l ${BTXLDR} \
-b ${BTXKERN} ${LOADERBIN}
.include <bsd.prog.mk>