1 # Works like the normal loader except the kernel, modules, and other loader
2 # files are loaded via TFTP instead of NFS.
4 # $DragonFly: src/sys/boot/pc32/loader_tftp/Makefile,v 1.2 2005/09/04 12:20:46 swildner Exp $
8 NEWVERSWHAT= "bootstrap loader" i386
12 # Notes: the 'loader' client is brought in with a virtual base of (typically)
13 # 0xa000 and a code offset of 0x0. The btxldr is loaded at 0x200000 (?).
15 # MEM_BTX_USR_ARG is not used in the boot2->loader stage, only in the
16 # boot1->boot2 stage (XXX what about the use in cdboot and pxeboot?)
20 .PATH: ${.CURDIR}/../loader
21 # architecture-specific loader code
24 CFLAGS+= -ffreestanding
25 CFLAGS+= -DLOADER_TFTP_SUPPORT
26 #CFLAGS+= -DLOADER_NFS_SUPPORT
28 # Enable PnP and ISA-PnP code.
35 CFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../../ficl -I${.CURDIR}/../../ficl/i386
36 .if exists(${.OBJDIR}/../../ficl/libficl.a)
37 LIBFICL= ${.OBJDIR}/../../ficl/libficl.a
39 LIBFICL= ${.CURDIR}/../../ficl/libficl.a
43 .if defined(LOADER_BZIP2_SUPPORT)
44 CFLAGS+= -DLOADER_BZIP2_SUPPORT
46 .if !defined(LOADER_NO_GZIP_SUPPORT)
47 CFLAGS+= -DLOADER_GZIP_SUPPORT
50 # Always add MI sources
51 .PATH: ${.CURDIR}/../../common
52 .include <${.CURDIR}/../../common/Makefile.inc>
53 CFLAGS+= -I${.CURDIR}/../../common
54 CFLAGS+= -I${.CURDIR}/../../.. -I.
56 CLEANFILES+= vers.c vers.o ${PROG}.list ${PROG}.bin ${PROG}.sym ${PROG}.help
59 LDFLAGS= -nostdlib -static -Ttext ${ORG}
61 # i386 standalone support library
62 LIBI386= ${.OBJDIR}/../libi386/libi386.a
63 CFLAGS+= -I${.CURDIR}/..
65 # where to get libstand from
66 #XXX need a better way to do this
67 LIBSTAND= ${.CURDIR}/../../../../lib/libstand/libstand.a
68 .if !exists(${LIBSTAND})
69 LIBSTAND= ${.OBJDIR}/../../../../lib/libstand/libstand.a
70 .if !exists(${LIBSTAND})
74 CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/
77 .if exists(${.OBJDIR}/../btx)
78 BTXDIR= ${.OBJDIR}/../btx
80 BTXDIR= ${.CURDIR}/../btx
82 BTXLDR= ${BTXDIR}/btxldr/btxldr
83 BTXKERN= ${BTXDIR}/btx/btx
84 BTXCRT= ${BTXDIR}/lib/crt0.o
85 CFLAGS+= -I${.CURDIR}/../btx/lib
87 # BTX is expecting ELF components
94 vers.o: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version
95 sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT}
96 ${CC} ${CFLAGS} -c vers.c
98 ${PROG}: ${PROG}.bin ${BTXLDR} ${BTXKERN} ${BTXCRT}
99 btxld -v -f aout -e ${LOADER_ADDRESS} -o ${.TARGET} -l ${BTXLDR} \
100 -b ${BTXKERN} ${PROG}.bin
101 # /usr/bin/kzip ${.TARGET}
102 # mv ${.TARGET}.kz ${.TARGET}
104 ${PROG}.bin: ${PROG}.sym
105 cp ${.ALLSRC} ${.TARGET}
106 strip -R .comment -R .note ${.TARGET}
108 ${PROG}.help: help.common help.i386
109 cat ${.ALLSRC} | awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET}
111 .PATH: ${.CURDIR}/../../forth
112 FILES= ${PROG}.help loader.4th support.4th loader.conf loader-bootp.conf
113 FILES+= screen.4th frames.4th beastie.4th
114 FILESDIR_loader.conf= /boot/defaults
115 FILESDIR_loader-bootp.conf= /boot/defaults
117 .if !exists(${DESTDIR}/boot/loader.rc)
118 FILES+= ${.CURDIR}/../loader/loader.rc
121 .include "../Makefile.inc"
123 # Cannot use ${OBJS} above this line
124 .include <bsd.prog.mk>
126 ${PROG}.sym: ${OBJS} ${LIBI386} ${LIBSTAND} ${LIBFICL} vers.o
127 ${CC} ${LDFLAGS} -o ${.TARGET} ${BTXCRT} ${OBJS} vers.o \
128 ${LIBFICL} ${LIBI386} ${LIBSTAND}
130 # If it's not there, don't consider it a target
131 .if exists(${.CURDIR}/../../../i386/include)
132 beforedepend ${OBJS}: machine
135 ${LN} -sf ${.CURDIR}/../../../i386/include machine