1998-11-12 07:40:51 +00:00
|
|
|
# $Id: Makefile,v 1.18 1998/11/04 03:42:36 msmith Exp $
|
1998-08-21 03:17:42 +00:00
|
|
|
|
1998-09-17 23:52:16 +00:00
|
|
|
BASE= loader
|
|
|
|
PROG= ${BASE}
|
1998-08-21 03:17:42 +00:00
|
|
|
NOMAN=
|
1998-10-01 09:57:09 +00:00
|
|
|
STRIP=
|
1998-08-21 03:17:42 +00:00
|
|
|
NEWVERSWHAT= "bootstrap loader"
|
1998-09-30 22:37:47 +00:00
|
|
|
BINDIR?= /boot
|
1998-08-21 03:17:42 +00:00
|
|
|
|
1998-09-17 23:52:16 +00:00
|
|
|
# architecture-specific loader code
|
|
|
|
SRCS= main.c conf.c
|
|
|
|
|
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
|
|
|
|
1998-11-04 00:30:47 +00:00
|
|
|
# Enable BootForth
|
1998-11-12 07:40:51 +00:00
|
|
|
BOOT_FORTH= yes
|
|
|
|
CFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../../ficl
|
|
|
|
.if exists(${.OBJDIR}/../../ficl/libficl.a)
|
|
|
|
LIBFICL= ${.OBJDIR}/../../ficl/libficl.a
|
|
|
|
.else
|
|
|
|
LIBFICL= ${.CURDIR}/../../ficl/libficl.a
|
|
|
|
.endif
|
1998-11-04 00:30:47 +00:00
|
|
|
|
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-10-23 22:32:27 +00:00
|
|
|
CLEANFILES+= vers.c vers.o ${BASE}.list ${BASE}.bin ${BASE}.sym
|
1998-08-21 03:17:42 +00:00
|
|
|
|
|
|
|
CFLAGS+= -Wall
|
1998-09-17 23:52:16 +00:00
|
|
|
LDFLAGS= -nostdlib -static -Ttext 0x1000
|
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
|
|
|
|
LIBSTAND= -lstand
|
|
|
|
#LIBSTAND= ${.CURDIR}/../../../lib/libstand/libstand.a
|
1998-09-26 01:31:10 +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-10-21 20:10:33 +00:00
|
|
|
# New linker set code
|
|
|
|
CFLAGS+= -DNEW_LINKER_SET
|
|
|
|
|
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
|
|
|
|
1998-08-21 03:17:42 +00:00
|
|
|
vers.o:
|
|
|
|
sh ${.CURDIR}/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT}
|
|
|
|
${CC} -c vers.c
|
|
|
|
|
1998-10-22 20:23:58 +00:00
|
|
|
${BASE}: ${BASE}.bin ${BTXLDR} ${BTXKERN} ${BTXCRT}
|
1998-09-18 02:03:30 +00:00
|
|
|
btxld -v -f aout -e 0x100000 -o ${.TARGET} -l ${BTXLDR} -b ${BTXKERN} \
|
|
|
|
${BASE}.bin
|
1998-09-17 23:52:16 +00:00
|
|
|
|
1998-10-21 20:10:33 +00:00
|
|
|
${BASE}.bin: ${BASE}.sym
|
|
|
|
cp ${.ALLSRC} ${.TARGET}
|
|
|
|
strip ${.TARGET}
|
1998-09-17 23:52:16 +00:00
|
|
|
|
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 \
|
1998-11-04 00:30:47 +00:00
|
|
|
${LIBFICL} ${LIBSTAND} ${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
|
1998-09-17 23:52:16 +00:00
|
|
|
|
|
|
|
|