1999-08-28 01:08:13 +00:00
|
|
|
# $FreeBSD$
|
1999-02-03 08:39:09 +00:00
|
|
|
|
|
|
|
BASE= loader
|
|
|
|
PROG= ${BASE}
|
|
|
|
STRIP=
|
1999-06-29 21:23:26 +00:00
|
|
|
NEWVERSWHAT= "bootstrap loader" pc98
|
1999-02-03 08:39:09 +00:00
|
|
|
BINDIR?= /boot
|
2001-09-12 10:25:50 +00:00
|
|
|
INSTALLFLAGS= -b
|
2002-03-30 11:18:30 +00:00
|
|
|
.if !defined(LOADER_NO_AOUT_SUPPORT)
|
|
|
|
LOADER_AOUT_SUPPORT= yes
|
|
|
|
.endif
|
1999-02-03 08:39:09 +00:00
|
|
|
|
2002-05-10 09:26:35 +00:00
|
|
|
CFLAGS+= -ffreestanding
|
1999-02-03 08:39:09 +00:00
|
|
|
CFLAGS+= -DPC98
|
|
|
|
|
|
|
|
# architecture-specific loader code
|
2000-04-23 09:33:31 +00:00
|
|
|
SRCS= main.c conf.c
|
2000-05-29 11:58:01 +00:00
|
|
|
.PATH: ${.CURDIR}/../../i386/loader
|
1999-02-03 08:39:09 +00:00
|
|
|
|
2000-04-14 13:51:14 +00:00
|
|
|
# Enable PXE TFTP or NFS support, not both.
|
2000-11-05 12:35:41 +00:00
|
|
|
.if defined(LOADER_TFTP_SUPPORT)
|
|
|
|
CFLAGS+= -DLOADER_TFTP_SUPPORT
|
|
|
|
.else
|
2000-04-14 13:51:14 +00:00
|
|
|
CFLAGS+= -DLOADER_NFS_SUPPORT
|
2000-11-05 12:35:41 +00:00
|
|
|
.endif
|
2000-04-14 13:51:14 +00:00
|
|
|
|
1999-02-03 08:39:09 +00:00
|
|
|
# Enable PnP and ISA-PnP code.
|
|
|
|
HAVE_PNP= yes
|
|
|
|
HAVE_ISABUS= yes
|
|
|
|
|
2000-02-05 02:21:31 +00:00
|
|
|
.if !defined(NOFORTH)
|
1999-02-03 08:39:09 +00:00
|
|
|
# Enable BootForth
|
|
|
|
BOOT_FORTH= yes
|
1999-11-25 12:46:16 +00:00
|
|
|
CFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../../ficl -I${.CURDIR}/../../ficl/i386
|
1999-02-03 08:39:09 +00:00
|
|
|
.if exists(${.OBJDIR}/../../ficl/libficl.a)
|
|
|
|
LIBFICL= ${.OBJDIR}/../../ficl/libficl.a
|
|
|
|
.else
|
|
|
|
LIBFICL= ${.CURDIR}/../../ficl/libficl.a
|
|
|
|
.endif
|
2000-02-05 02:21:31 +00:00
|
|
|
.endif
|
1999-02-03 08:39:09 +00:00
|
|
|
|
2001-10-17 14:13:36 +00:00
|
|
|
.if defined(LOADER_BZIP2_SUPPORT)
|
|
|
|
CFLAGS+= -DLOADER_BZIP2_SUPPORT
|
|
|
|
.endif
|
|
|
|
.if !defined(LOADER_NO_GZIP_SUPPORT)
|
|
|
|
CFLAGS+= -DLOADER_GZIP_SUPPORT
|
|
|
|
.endif
|
|
|
|
|
1999-02-03 08:39:09 +00:00
|
|
|
# Always add MI sources
|
|
|
|
.PATH: ${.CURDIR}/../../common
|
|
|
|
.include <${.CURDIR}/../../common/Makefile.inc>
|
|
|
|
CFLAGS+= -I${.CURDIR}/../../common
|
|
|
|
CFLAGS+= -I${.CURDIR}/../../.. -I. -I${.CURDIR}/../../i386
|
|
|
|
|
|
|
|
CLEANFILES+= vers.c vers.o ${BASE}.list ${BASE}.bin ${BASE}.sym ${BASE}.help
|
|
|
|
|
|
|
|
CFLAGS+= -Wall
|
1999-02-25 11:01:54 +00:00
|
|
|
LDFLAGS= -nostdlib -static -Ttext 0x0
|
1999-02-03 08:39:09 +00:00
|
|
|
|
|
|
|
# pc98 standalone support library
|
|
|
|
LIBPC98= ${.OBJDIR}/../libpc98/libpc98.a
|
|
|
|
CFLAGS+= -I${.CURDIR}/..
|
|
|
|
|
|
|
|
# where to get libstand from
|
2000-09-08 11:18:40 +00:00
|
|
|
#XXX need a better way to do this
|
|
|
|
LIBSTAND= ${.CURDIR}/../../../../lib/libstand/libstand.a
|
|
|
|
.if !exists(${LIBSTAND})
|
|
|
|
LIBSTAND= ${.OBJDIR}/../../../../lib/libstand/libstand.a
|
|
|
|
.if !exists(${LIBSTAND})
|
1999-02-03 08:39:09 +00:00
|
|
|
LIBSTAND= -lstand
|
2000-09-08 11:18:40 +00:00
|
|
|
.endif
|
|
|
|
.endif
|
2000-04-14 13:51:14 +00:00
|
|
|
CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/
|
1999-02-03 08:39:09 +00:00
|
|
|
|
|
|
|
# BTX components
|
|
|
|
.if exists(${.OBJDIR}/../btx)
|
|
|
|
BTXDIR= ${.OBJDIR}/../btx
|
|
|
|
.else
|
|
|
|
BTXDIR= ${.CURDIR}/../btx
|
|
|
|
.endif
|
|
|
|
BTXLDR= ${BTXDIR}/btxldr/btxldr
|
|
|
|
BTXKERN= ${BTXDIR}/btx/btx
|
|
|
|
BTXCRT= ${BTXDIR}/lib/crt0.o
|
|
|
|
CFLAGS+= -I${.CURDIR}/../btx/lib
|
|
|
|
|
|
|
|
# BTX is expecting ELF components
|
|
|
|
CFLAGS+= -elf
|
|
|
|
|
|
|
|
# Debug me!
|
|
|
|
#CFLAGS+= -g
|
|
|
|
#LDFLAGS+= -g
|
|
|
|
|
1999-06-29 21:23:26 +00:00
|
|
|
vers.o: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/../../i386/loader/version
|
|
|
|
sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/../../i386/loader/version ${NEWVERSWHAT}
|
1999-02-03 08:39:09 +00:00
|
|
|
${CC} -c vers.c
|
|
|
|
|
2002-04-25 13:31:27 +00:00
|
|
|
${BASE}: ${BASE}.bin ${BTXLDR} ${BTXKERN} ${BTXCRT}
|
2000-03-31 16:03:02 +00:00
|
|
|
btxld -v -f aout -e ${LOADER_ADDRESS} -o ${.TARGET} -l ${BTXLDR} \
|
|
|
|
-b ${BTXKERN} ${BASE}.bin
|
1999-02-03 08:39:09 +00:00
|
|
|
# /usr/bin/kzip ${.TARGET}
|
|
|
|
# mv ${.TARGET}.kz ${.TARGET}
|
|
|
|
|
|
|
|
${BASE}.bin: ${BASE}.sym
|
|
|
|
cp ${.ALLSRC} ${.TARGET}
|
2000-12-16 03:15:48 +00:00
|
|
|
strip -R .comment -R .note ${.TARGET}
|
1999-02-03 08:39:09 +00:00
|
|
|
|
1999-04-02 08:59:11 +00:00
|
|
|
${BASE}.help: help.common help.i386
|
1999-02-03 08:39:09 +00:00
|
|
|
cat ${.ALLSRC} | awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET}
|
|
|
|
|
2002-04-25 13:31:27 +00:00
|
|
|
.PATH: ${.CURDIR}/../../forth
|
|
|
|
FILES= ${BASE}.help loader.4th support.4th loader.conf
|
|
|
|
FILESDIR_loader.conf= /boot/defaults
|
|
|
|
|
1999-11-16 00:38:20 +00:00
|
|
|
.if !exists(${DESTDIR}/boot/loader.rc)
|
2002-04-25 13:31:27 +00:00
|
|
|
FILES+= loader.rc
|
1999-02-03 08:39:09 +00:00
|
|
|
.endif
|
|
|
|
|
2000-03-31 16:03:02 +00:00
|
|
|
.include <${.CURDIR}/../Makefile.inc>
|
|
|
|
|
1999-02-03 08:39:09 +00:00
|
|
|
# Cannot use ${OBJS} above this line
|
|
|
|
.include <bsd.prog.mk>
|
|
|
|
|
|
|
|
${BASE}.sym: ${OBJS} ${LIBPC98} ${LIBSTAND} ${LIBFICL} vers.o
|
|
|
|
${CC} ${LDFLAGS} -o ${.TARGET} ${BTXCRT} ${OBJS} vers.o \
|
2000-04-23 09:33:31 +00:00
|
|
|
${LIBFICL} ${LIBPC98} ${LIBSTAND}
|
1999-02-03 08:39:09 +00:00
|
|
|
|
|
|
|
# If it's not there, don't consider it a target
|
|
|
|
.if exists(${.CURDIR}/../../../i386/include)
|
|
|
|
beforedepend ${OBJS}: machine
|
|
|
|
|
|
|
|
machine:
|
|
|
|
ln -sf ${.CURDIR}/../../../i386/include machine
|
|
|
|
|
|
|
|
.endif
|
|
|
|
|
|
|
|
CLEANFILES+= machine
|