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