AMD64 - Fix native-built sys/boot install
[dragonfly.git] / sys / boot / pc32 / pxeldr / Makefile
CommitLineData
5ee58eed 1# $FreeBSD: src/sys/boot/i386/pxeldr/Makefile,v 1.9 2003/09/03 08:12:20 phk Exp $
409cbc03 2# $DragonFly: src/sys/boot/pc32/pxeldr/Makefile,v 1.5 2004/07/18 23:40:09 dillon Exp $
984263bc
MD
3
4ORG= 0x7c00
5
6LDR= pxeldr
6c644be3
SS
7BOOT?= pxeboot
8LOADER?= loader
984263bc
MD
9PROG= ${BOOT}
10MAN= ${BOOT}.8
11STRIP=
12BINDIR?= /boot
984263bc
MD
13
14.if defined(BOOT_PXELDR_PROBE_KEYBOARD)
72f919a1 15CFLAGS+= -DPROBE_KEYBOARD
984263bc
MD
16.endif
17
5ee58eed 18.if defined(BOOT_PXELDR_ALWAYS_SERIAL)
72f919a1 19CFLAGS+= -DALWAYS_SERIAL
5ee58eed
MD
20.endif
21
22
984263bc 23.if exists(${.OBJDIR}/../loader)
72f919a1 24LOADERBIN?= ${.OBJDIR}/../loader/loader.bin
984263bc 25.else
72f919a1 26LOADERBIN?= ${.CURDIR}/../loader/loader.bin
984263bc
MD
27.endif
28
5ee58eed
MD
29# BTX components
30.if exists(${.OBJDIR}/../btx)
31BTXDIR= ${.OBJDIR}/../btx
32.else
33BTXDIR= ${.CURDIR}/../btx
34.endif
35BTXLDR= ${BTXDIR}/btxldr/btxldr
36BTXKERN= ${BTXDIR}/btx/btx
37BTXCRT= ${BTXDIR}/lib/crt0.o
38
984263bc
MD
39${BOOT}: ${LDR} ${LOADER}
40 cat ${LDR} ${LOADER} > ${.TARGET}.tmp
41 dd if=${.TARGET}.tmp of=${.TARGET} obs=2k conv=osync
42 rm ${.TARGET}.tmp
43
5ee58eed
MD
44${LOADER}: ${LOADERBIN} ${BTXLDR} ${BTXKERN} ${BTXCRT}
45 btxld -v -f aout -e ${LOADER_ADDRESS} -o ${.TARGET} -l ${BTXLDR} \
46 -b ${BTXKERN} ${LOADERBIN}
47
984263bc 48${LDR}: ${LDR}.o
79b4bbd6 49 ${LD} ${LDFLAGS} -N -e start -Ttext ${ORG} -o ${LDR}.out ${LDR}.o
984263bc 50 objcopy -S -O binary ${LDR}.out ${.TARGET}
984263bc 51
409cbc03 52${LDR}.o: ${LDR}.S
72f919a1 53 ${CC} ${CFLAGS} ${.IMPSRC} -o ${LDR}.o -c
984263bc 54
5ee58eed 55CLEANFILES+= ${LDR} ${LDR}.out ${LDR}.o ${BOOT}.tmp ${LOADER}
984263bc
MD
56
57.include <bsd.prog.mk>