2000-10-16 10:46:22 +00:00
|
|
|
# $FreeBSD$
|
|
|
|
|
|
|
|
BASE= loader
|
|
|
|
PROG= ${BASE}
|
|
|
|
NOMAN=
|
2000-11-10 06:39:58 +00:00
|
|
|
STRIP=
|
2000-10-16 10:46:22 +00:00
|
|
|
NEWVERSWHAT= "bootstrap loader" OpenFirmware/PowerPC
|
|
|
|
BINDIR?= /boot
|
2001-09-12 10:25:50 +00:00
|
|
|
INSTALLFLAGS= -b
|
2000-10-16 10:46:22 +00:00
|
|
|
|
2000-11-10 06:39:58 +00:00
|
|
|
LOADER_DISK_SUPPORT?= yes
|
|
|
|
LOADER_NET_SUPPORT?= yes
|
2000-10-16 10:46:22 +00:00
|
|
|
|
2002-05-10 09:26:35 +00:00
|
|
|
CFLAGS+= -ffreestanding
|
2001-10-07 13:22:25 +00:00
|
|
|
# load address
|
|
|
|
RELOC?= 0x6c0000
|
|
|
|
CFLAGS+= -DRELOC=${RELOC}
|
|
|
|
|
2000-10-16 10:46:22 +00:00
|
|
|
# architecture-specific loader code
|
|
|
|
SRCS= conf.c
|
|
|
|
|
2000-11-10 06:39:58 +00:00
|
|
|
# Pull in common loader code
|
|
|
|
.PATH: ${.CURDIR}/../../ofw/common
|
|
|
|
.include <${.CURDIR}/../../ofw/common/Makefile.inc>
|
|
|
|
|
|
|
|
.if defined(LOADER_DISK_SUPPORT)
|
2000-10-16 10:46:22 +00:00
|
|
|
CFLAGS+= -DLOADER_DISK_SUPPORT
|
2000-11-10 06:39:58 +00:00
|
|
|
.endif
|
|
|
|
.if defined(LOADER_NET_SUPPORT)
|
|
|
|
CFLAGS+= -DLOADER_NET_SUPPORT
|
|
|
|
.endif
|
2000-10-16 10:46:22 +00:00
|
|
|
|
|
|
|
.if !defined(NOFORTH)
|
|
|
|
# Enable BootForth
|
|
|
|
BOOT_FORTH= yes
|
|
|
|
CFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../../ficl -I${.CURDIR}/../../ficl/powerpc
|
|
|
|
.if exists(${.OBJDIR}/../../ficl/libficl.a)
|
|
|
|
LIBFICL= ${.OBJDIR}/../../ficl/libficl.a
|
|
|
|
.else
|
|
|
|
LIBFICL= ${.CURDIR}/../../ficl/libficl.a
|
|
|
|
.endif
|
|
|
|
.endif
|
|
|
|
|
|
|
|
# Always add MI sources
|
2000-11-10 06:39:58 +00:00
|
|
|
.PATH: ${.CURDIR}/../../common
|
|
|
|
.include <${.CURDIR}/../../common/Makefile.inc>
|
|
|
|
CFLAGS+= -I${.CURDIR}/../../common
|
|
|
|
CFLAGS+= -I${.CURDIR}/../../.. -I.
|
2000-10-16 10:46:22 +00:00
|
|
|
|
|
|
|
CLEANFILES+= vers.c vers.o ${BASE}.list ${BASE}.bin ${BASE}.sym ${BASE}.help
|
|
|
|
|
2001-10-07 13:22:25 +00:00
|
|
|
LDFLAGS= -nostdlib -static -Ttext ${RELOC}
|
2000-10-16 10:46:22 +00:00
|
|
|
|
|
|
|
# OpenFirmware standalone support library
|
|
|
|
LIBOFW= ${.OBJDIR}/../../ofw/libofw/libofw.a
|
|
|
|
CFLAGS+= -I${.CURDIR}/../../ofw/libofw
|
|
|
|
|
|
|
|
# where to get libstand from
|
|
|
|
#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})
|
|
|
|
#LIBSTAND= -lstand
|
|
|
|
#.endif
|
|
|
|
#.endif
|
|
|
|
CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/
|
|
|
|
|
|
|
|
# OpenFirmware is expecting ELF components
|
|
|
|
CFLAGS+= -elf
|
|
|
|
|
2000-11-10 06:39:58 +00:00
|
|
|
# Debug me!
|
|
|
|
CFLAGS+= -g
|
|
|
|
LDFLAGS+= -g
|
|
|
|
|
2000-10-16 10:46:22 +00:00
|
|
|
vers.o: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version
|
|
|
|
sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT}
|
|
|
|
${CC} -c vers.c
|
|
|
|
|
|
|
|
${BASE}.help: help.common help.ofw
|
2000-11-10 06:39:58 +00:00
|
|
|
cat ${.ALLSRC} | awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET}
|
2000-10-16 10:46:22 +00:00
|
|
|
|
|
|
|
beforeinstall:
|
|
|
|
.if exists(${.OBJDIR}/loader.help)
|
|
|
|
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
|
2000-11-10 06:39:58 +00:00
|
|
|
${.OBJDIR}/${BASE}.help ${DESTDIR}/boot
|
2000-10-16 10:46:22 +00:00
|
|
|
.else
|
|
|
|
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
|
2000-11-10 06:39:58 +00:00
|
|
|
${.CURDIR}/${BASE}.help ${DESTDIR}/boot
|
2000-10-16 10:46:22 +00:00
|
|
|
.endif
|
|
|
|
.if !exists(${DESTDIR}/boot/loader.rc)
|
|
|
|
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
|
2000-11-10 06:39:58 +00:00
|
|
|
${.CURDIR}/../../forth/loader.rc ${DESTDIR}/boot
|
2000-10-16 10:46:22 +00:00
|
|
|
.endif
|
|
|
|
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
|
2000-11-10 06:39:58 +00:00
|
|
|
${.CURDIR}/../../forth/loader.4th ${DESTDIR}/boot
|
2000-10-16 10:46:22 +00:00
|
|
|
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
|
2000-11-10 06:39:58 +00:00
|
|
|
${.CURDIR}/../../forth/support.4th ${DESTDIR}/boot
|
2000-10-16 10:46:22 +00:00
|
|
|
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
|
2000-11-10 06:39:58 +00:00
|
|
|
${.CURDIR}/../../forth/loader.conf ${DESTDIR}/boot/defaults
|
|
|
|
|
2001-06-14 01:23:57 +00:00
|
|
|
${PROG}: ${OBJS} ${LIBOFW} ${LIBSTAND} ${LIBFICL} start.o vers.o
|
|
|
|
${LD} ${LDFLAGS} -o ${.TARGET} start.o ${OBJS} \
|
2000-11-10 06:39:58 +00:00
|
|
|
vers.o ${LIBFICL} ${LIBOFW} ${LIBSTAND}
|
2000-10-16 10:46:22 +00:00
|
|
|
|
2000-11-10 06:39:58 +00:00
|
|
|
machine:
|
|
|
|
ln -sf ${.CURDIR}/../../../powerpc/include machine
|
2000-10-16 10:46:22 +00:00
|
|
|
|
|
|
|
# Cannot use ${OBJS} above this line
|
|
|
|
.include <bsd.prog.mk>
|
|
|
|
|
|
|
|
beforedepend ${OBJS}: machine
|
|
|
|
|
|
|
|
CLEANFILES+= machine setdefs.h setdef0.c setdef1.c setdef0.o setdef1.o \
|
2000-11-10 06:39:58 +00:00
|
|
|
start.o
|