1999-08-28 01:08:13 +00:00
|
|
|
# $FreeBSD$
|
1999-02-03 08:39:09 +00:00
|
|
|
|
|
|
|
BASE= loader
|
|
|
|
PROG= ${BASE}
|
1999-03-18 13:42:21 +00:00
|
|
|
#NOMAN=
|
1999-02-03 08:39:09 +00:00
|
|
|
STRIP=
|
1999-06-29 21:23:26 +00:00
|
|
|
NEWVERSWHAT= "bootstrap loader" pc98
|
1999-02-03 08:39:09 +00:00
|
|
|
BINDIR?= /boot
|
|
|
|
|
|
|
|
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.
|
|
|
|
CFLAGS+= -DLOADER_NFS_SUPPORT
|
|
|
|
#CFLAGS+= -DLOADER_TFTP_SUPPORT
|
|
|
|
|
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
|
|
|
|
|
|
|
# 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
|
|
|
|
LIBSTAND= -lstand
|
2000-04-14 13:51:14 +00:00
|
|
|
#LIBSTAND= ${.CURDIR}/../../../../lib/libstand/libstand.a
|
|
|
|
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
|
|
|
|
|
|
|
|
# New linker set code
|
|
|
|
CFLAGS+= -DNEW_LINKER_SET
|
|
|
|
|
|
|
|
# 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
|
|
|
|
|
|
|
|
${BASE}: ${BASE}.bin ${BTXLDR} ${BTXKERN} ${BTXCRT} ${BASE}.help
|
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}
|
|
|
|
strip ${.TARGET}
|
|
|
|
|
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}
|
|
|
|
|
|
|
|
beforeinstall:
|
|
|
|
.if exists(${DESTDIR}/boot/loader)
|
|
|
|
mv ${DESTDIR}/boot/loader ${DESTDIR}/boot/loader.old
|
|
|
|
.endif
|
|
|
|
.if exists(${.OBJDIR}/loader.help)
|
|
|
|
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
|
|
|
|
${.OBJDIR}/${BASE}.help ${DESTDIR}/boot
|
|
|
|
.else
|
|
|
|
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
|
|
|
|
${.CURDIR}/${BASE}.help ${DESTDIR}/boot
|
1999-11-16 00:38:20 +00:00
|
|
|
.endif
|
|
|
|
.if !exists(${DESTDIR}/boot/loader.rc)
|
|
|
|
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
|
|
|
|
${.CURDIR}/../../forth/loader.rc ${DESTDIR}/boot
|
1999-02-03 08:39:09 +00:00
|
|
|
.endif
|
1999-03-10 13:41:44 +00:00
|
|
|
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
|
|
|
|
${.CURDIR}/../../forth/loader.4th ${DESTDIR}/boot
|
|
|
|
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
|
|
|
|
${.CURDIR}/../../forth/support.4th ${DESTDIR}/boot
|
|
|
|
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
|
|
|
|
${.CURDIR}/../../forth/loader.conf ${DESTDIR}/boot/defaults
|
1999-02-03 08:39:09 +00:00
|
|
|
|
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
|