6 NEWVERSWHAT= "bootstrap loader" pc98
9 .if !defined(LOADER_NO_AOUT_SUPPORT)
10 LOADER_AOUT_SUPPORT= yes
15 # architecture-specific loader code
17 .PATH: ${.CURDIR}/../../i386/loader
19 # Enable PXE TFTP or NFS support, not both.
20 .if defined(LOADER_TFTP_SUPPORT)
21 CFLAGS+= -DLOADER_TFTP_SUPPORT
23 CFLAGS+= -DLOADER_NFS_SUPPORT
26 # Enable PnP and ISA-PnP code.
33 CFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../../ficl -I${.CURDIR}/../../ficl/i386
34 .if exists(${.OBJDIR}/../../ficl/libficl.a)
35 LIBFICL= ${.OBJDIR}/../../ficl/libficl.a
37 LIBFICL= ${.CURDIR}/../../ficl/libficl.a
41 .if defined(LOADER_BZIP2_SUPPORT)
42 CFLAGS+= -DLOADER_BZIP2_SUPPORT
44 .if !defined(LOADER_NO_GZIP_SUPPORT)
45 CFLAGS+= -DLOADER_GZIP_SUPPORT
48 # Always add MI sources
49 .PATH: ${.CURDIR}/../../common
50 .include <${.CURDIR}/../../common/Makefile.inc>
51 CFLAGS+= -I${.CURDIR}/../../common
52 CFLAGS+= -I${.CURDIR}/../../.. -I. -I${.CURDIR}/../../i386
54 CLEANFILES+= vers.c vers.o ${BASE}.list ${BASE}.bin ${BASE}.sym ${BASE}.help
57 LDFLAGS= -nostdlib -static -Ttext 0x0
59 # pc98 standalone support library
60 LIBPC98= ${.OBJDIR}/../libpc98/libpc98.a
61 CFLAGS+= -I${.CURDIR}/..
63 # where to get libstand from
64 #XXX need a better way to do this
65 LIBSTAND= ${.CURDIR}/../../../../lib/libstand/libstand.a
66 .if !exists(${LIBSTAND})
67 LIBSTAND= ${.OBJDIR}/../../../../lib/libstand/libstand.a
68 .if !exists(${LIBSTAND})
72 CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/
75 .if exists(${.OBJDIR}/../btx)
76 BTXDIR= ${.OBJDIR}/../btx
78 BTXDIR= ${.CURDIR}/../btx
80 BTXLDR= ${BTXDIR}/btxldr/btxldr
81 BTXKERN= ${BTXDIR}/btx/btx
82 BTXCRT= ${BTXDIR}/lib/crt0.o
83 CFLAGS+= -I${.CURDIR}/../btx/lib
85 # BTX is expecting ELF components
92 vers.o: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/../../i386/loader/version
93 sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/../../i386/loader/version ${NEWVERSWHAT}
96 ${BASE}: ${BASE}.bin ${BTXLDR} ${BTXKERN} ${BTXCRT}
97 btxld -v -f aout -e ${LOADER_ADDRESS} -o ${.TARGET} -l ${BTXLDR} \
98 -b ${BTXKERN} ${BASE}.bin
99 # /usr/bin/kzip ${.TARGET}
100 # mv ${.TARGET}.kz ${.TARGET}
102 ${BASE}.bin: ${BASE}.sym
103 cp ${.ALLSRC} ${.TARGET}
104 strip -R .comment -R .note ${.TARGET}
106 ${BASE}.help: help.common help.i386
107 cat ${.ALLSRC} | awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET}
109 .PATH: ${.CURDIR}/../../forth
110 FILES= ${BASE}.help loader.4th support.4th loader.conf
111 FILESDIR_loader.conf= /boot/defaults
113 .if !exists(${DESTDIR}/boot/loader.rc)
117 .include <${.CURDIR}/../Makefile.inc>
119 # Cannot use ${OBJS} above this line
120 .include <bsd.prog.mk>
122 ${BASE}.sym: ${OBJS} ${LIBPC98} ${LIBSTAND} ${LIBFICL} vers.o
123 ${CC} ${LDFLAGS} -o ${.TARGET} ${BTXCRT} ${OBJS} vers.o \
124 ${LIBFICL} ${LIBPC98} ${LIBSTAND}
126 # If it's not there, don't consider it a target
127 .if exists(${.CURDIR}/../../../i386/include)
128 beforedepend ${OBJS}: machine
131 ln -sf ${.CURDIR}/../../../i386/include machine