Fully synchronize sys/boot from FreeBSD-5.x, but add / to the module path
[dragonfly.git] / sys / boot / i386 / pxeldr / Makefile
CommitLineData
5ee58eed
MD
1# $FreeBSD: src/sys/boot/i386/pxeldr/Makefile,v 1.9 2003/09/03 08:12:20 phk Exp $
2# $DragonFly: src/sys/boot/i386/pxeldr/Attic/Makefile,v 1.3 2003/11/10 06:08:37 dillon Exp $
984263bc
MD
3
4MAINTAINER=jhb@FreeBSD.org
5
6ORG= 0x7c00
7
8LDR= pxeldr
9BOOT= pxeboot
5ee58eed 10LOADER= loader
984263bc
MD
11PROG= ${BOOT}
12MAN= ${BOOT}.8
13STRIP=
14BINDIR?= /boot
15M4?= m4
16
17.if defined(BOOT_PXELDR_PROBE_KEYBOARD)
18M4FLAGS+= -DPROBE_KEYBOARD
19.endif
20
5ee58eed
MD
21.if defined(BOOT_PXELDR_ALWAYS_SERIAL)
22M4FLAGS+= -DALWAYS_SERIAL
23.endif
24
25
984263bc 26.if exists(${.OBJDIR}/../loader)
5ee58eed 27LOADERBIN= ${.OBJDIR}/../loader/loader.bin
984263bc 28.else
5ee58eed 29LOADERBIN= ${.CURDIR}/../loader/loader.bin
984263bc
MD
30.endif
31
5ee58eed
MD
32# BTX components
33.if exists(${.OBJDIR}/../btx)
34BTXDIR= ${.OBJDIR}/../btx
35.else
36BTXDIR= ${.CURDIR}/../btx
37.endif
38BTXLDR= ${BTXDIR}/btxldr/btxldr
39BTXKERN= ${BTXDIR}/btx/btx
40BTXCRT= ${BTXDIR}/lib/crt0.o
41
984263bc
MD
42${BOOT}: ${LDR} ${LOADER}
43 cat ${LDR} ${LOADER} > ${.TARGET}.tmp
44 dd if=${.TARGET}.tmp of=${.TARGET} obs=2k conv=osync
45 rm ${.TARGET}.tmp
46
5ee58eed
MD
47${LOADER}: ${LOADERBIN} ${BTXLDR} ${BTXKERN} ${BTXCRT}
48 btxld -v -f aout -e ${LOADER_ADDRESS} -o ${.TARGET} -l ${BTXLDR} \
49 -b ${BTXKERN} ${LOADERBIN}
50
984263bc 51${LDR}: ${LDR}.o
984263bc
MD
52 ${LD} -N -e start -Ttext ${ORG} -o ${LDR}.out ${LDR}.o
53 objcopy -S -O binary ${LDR}.out ${.TARGET}
984263bc
MD
54
55${LDR}.o: ${LDR}.s
56 (cd ${.CURDIR}; ${M4} ${M4FLAGS} ${LDR}.s) | \
57 ${AS} ${AFLAGS} -o ${.TARGET}
58
5ee58eed 59CLEANFILES+= ${LDR} ${LDR}.out ${LDR}.o ${BOOT}.tmp ${LOADER}
984263bc
MD
60
61.include <bsd.prog.mk>