btxld(8): Convert to hostprog.
[dragonfly.git] / sys / boot / pc32 / pxeldr / Makefile
blobdeb9049cfb989f5c520027be20abce9b619fd2ff
1 # $FreeBSD: src/sys/boot/i386/pxeldr/Makefile,v 1.9 2003/09/03 08:12:20 phk Exp $
3 ORG= 0x7c00
5 LDR= pxeldr
6 BOOT?= pxeboot
7 LOADER?= loader
8 PROG= ${BOOT}
9 MAN= ${BOOT}.8
10 STRIP=
11 BINDIR?= /boot
13 .if defined(BOOT_PXELDR_PROBE_KEYBOARD)
14 CFLAGS+= -DPROBE_KEYBOARD
15 .endif
17 .if defined(BOOT_PXELDR_ALWAYS_SERIAL)
18 CFLAGS+= -DALWAYS_SERIAL
19 .endif
22 .if exists(${.OBJDIR}/../loader)
23 LOADERBIN?= ${.OBJDIR}/../loader/loader.bin
24 .else
25 LOADERBIN?= ${.CURDIR}/../loader/loader.bin
26 .endif
28 # BTX components
29 .if exists(${.OBJDIR}/../btx)
30 BTXDIR= ${.OBJDIR}/../btx
31 .else
32 BTXDIR= ${.CURDIR}/../btx
33 .endif
34 BTXLDR= ${BTXDIR}/btxldr/btxldr
35 BTXKERN= ${BTXDIR}/btx/btx
36 BTXCRT= ${BTXDIR}/lib/crt0.o
38 ${BOOT}: ${LDR} ${LOADER}
39 cat ${LDR} ${LOADER} > ${.TARGET}.tmp
40 dd if=${.TARGET}.tmp of=${.TARGET} obs=2k conv=osync
41 rm ${.TARGET}.tmp
43 ${LOADER}: ${LOADERBIN} ${BTXLDR} ${BTXKERN} ${BTXCRT}
44 ${.OBJDIR}/../btxld/btxld.nx -v -f aout -e ${LOADER_ADDRESS} \
45 -o ${.TARGET} -l ${BTXLDR} -b ${BTXKERN} ${LOADERBIN}
47 ${LDR}: ${LDR}.o
48 ${LD} ${LDFLAGS:N-Wl,*} -N -e start -Ttext ${ORG} -o ${LDR}.out ${LDR}.o
49 objcopy -S -O binary ${LDR}.out ${.TARGET}
51 ${LDR}.o: ${LDR}.S
52 ${CC} ${CFLAGS} ${.IMPSRC} -o ${LDR}.o -c
54 CLEANFILES+= ${LDR} ${LDR}.out ${LDR}.o ${BOOT}.tmp ${LOADER}
56 .include <bsd.prog.mk>