2000-10-16 10:46:22 +00:00
|
|
|
# $FreeBSD$
|
|
|
|
|
2004-02-09 21:54:54 +00:00
|
|
|
PROG= loader
|
2000-10-16 10:46:22 +00:00
|
|
|
NOMAN=
|
|
|
|
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
|
|
|
|
2004-02-09 21:54:54 +00:00
|
|
|
# Architecture-specific loader code
|
2003-12-10 09:16:22 +00:00
|
|
|
SRCS= conf.c metadata.c vers.c start.c
|
2000-10-16 10:46:22 +00:00
|
|
|
|
2003-12-10 09:16:22 +00:00
|
|
|
LOADER_DISK_SUPPORT?= yes
|
|
|
|
LOADER_UFS_SUPPORT?= yes
|
|
|
|
LOADER_CD9660_SUPPORT?= yes
|
|
|
|
LOADER_EXT2FS_SUPPORT?= no
|
|
|
|
LOADER_NET_SUPPORT?= yes
|
|
|
|
LOADER_NFS_SUPPORT?= yes
|
|
|
|
LOADER_TFTP_SUPPORT?= yes
|
|
|
|
LOADER_GZIP_SUPPORT?= yes
|
|
|
|
LOADER_BZIP2_SUPPORT?= no
|
2000-11-10 06:39:58 +00:00
|
|
|
|
2004-02-09 21:54:54 +00:00
|
|
|
.if ${LOADER_DISK_SUPPORT} == "yes"
|
2000-10-16 10:46:22 +00:00
|
|
|
CFLAGS+= -DLOADER_DISK_SUPPORT
|
2000-11-10 06:39:58 +00:00
|
|
|
.endif
|
2003-12-10 09:16:22 +00:00
|
|
|
.if ${LOADER_UFS_SUPPORT} == "yes"
|
|
|
|
CFLAGS+= -DLOADER_UFS_SUPPORT
|
|
|
|
.endif
|
|
|
|
.if ${LOADER_CD9660_SUPPORT} == "yes"
|
|
|
|
CFLAGS+= -DLOADER_CD9660_SUPPORT
|
|
|
|
.endif
|
|
|
|
.if ${LOADER_EXT2FS_SUPPORT} == "yes"
|
|
|
|
CFLAGS+= -DLOADER_EXT2FS_SUPPORT
|
|
|
|
.endif
|
2004-02-09 21:54:54 +00:00
|
|
|
.if ${LOADER_GZIP_SUPPORT} == "yes"
|
|
|
|
CFLAGS+= -DLOADER_GZIP_SUPPORT
|
|
|
|
.endif
|
|
|
|
.if ${LOADER_BZIP2_SUPPORT} == "yes"
|
|
|
|
CFLAGS+= -DLOADER_BZIP2_SUPPORT
|
|
|
|
.endif
|
|
|
|
.if ${LOADER_NET_SUPPORT} == "yes"
|
2000-11-10 06:39:58 +00:00
|
|
|
CFLAGS+= -DLOADER_NET_SUPPORT
|
|
|
|
.endif
|
2003-12-10 09:16:22 +00:00
|
|
|
.if ${LOADER_NFS_SUPPORT} == "yes"
|
|
|
|
CFLAGS+= -DLOADER_NFS_SUPPORT
|
|
|
|
.endif
|
|
|
|
.if ${LOADER_TFTP_SUPPORT} == "yes"
|
|
|
|
CFLAGS+= -DLOADER_TFTP_SUPPORT
|
|
|
|
.endif
|
2000-10-16 10:46:22 +00:00
|
|
|
|
2003-12-10 09:16:22 +00:00
|
|
|
.if !defined(NOFORTH)
|
|
|
|
# Enable BootForth
|
|
|
|
BOOT_FORTH= yes
|
|
|
|
CFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../../ficl -I${.CURDIR}/../../ficl/powerpc
|
|
|
|
LIBFICL= ${.OBJDIR}/../../ficl/libficl.a
|
|
|
|
.endif
|
2000-10-16 10:46:22 +00:00
|
|
|
|
2004-02-09 21:54:54 +00:00
|
|
|
# Always add MI sources
|
2000-11-10 06:39:58 +00:00
|
|
|
.PATH: ${.CURDIR}/../../common
|
2004-02-09 21:54:54 +00:00
|
|
|
.include "${.CURDIR}/../../common/Makefile.inc"
|
2000-11-10 06:39:58 +00:00
|
|
|
CFLAGS+= -I${.CURDIR}/../../common
|
2004-02-09 21:54:54 +00:00
|
|
|
CFLAGS+= -I.
|
2000-10-16 10:46:22 +00:00
|
|
|
|
2004-02-09 21:54:54 +00:00
|
|
|
CLEANFILES+= vers.c loader.help
|
2000-10-16 10:46:22 +00:00
|
|
|
|
2003-12-10 09:16:22 +00:00
|
|
|
CFLAGS+= -ffreestanding
|
2004-07-08 12:52:35 +00:00
|
|
|
# load address. set in linker script
|
2003-12-10 09:16:22 +00:00
|
|
|
RELOC?= 0x1C00000
|
|
|
|
CFLAGS+= -DRELOC=${RELOC}
|
2004-07-08 12:52:35 +00:00
|
|
|
|
|
|
|
LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.powerpc
|
2000-10-16 10:46:22 +00:00
|
|
|
|
2003-12-10 09:16:22 +00:00
|
|
|
# Pull in common loader code
|
|
|
|
.PATH: ${.CURDIR}/../../ofw/common
|
2004-02-09 21:54:54 +00:00
|
|
|
.include "${.CURDIR}/../../ofw/common/Makefile.inc"
|
2003-12-10 09:16:22 +00:00
|
|
|
|
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
|
|
|
|
CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/
|
|
|
|
|
2004-02-09 21:54:54 +00:00
|
|
|
DPADD= ${LIBFICL} ${LIBOFW} ${LIBSTAND}
|
|
|
|
LDADD= ${LIBFICL} ${LIBOFW} -lstand
|
2000-11-10 06:39:58 +00:00
|
|
|
|
2003-12-10 09:16:22 +00:00
|
|
|
vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version
|
2000-10-16 10:46:22 +00:00
|
|
|
sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT}
|
|
|
|
|
2004-02-09 21:54:54 +00:00
|
|
|
loader.help: help.common help.ofw
|
2003-12-10 09:16:22 +00:00
|
|
|
cat ${.ALLSRC} | \
|
|
|
|
awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET}
|
|
|
|
|
|
|
|
.PATH: ${.CURDIR}/../../forth
|
2004-02-09 21:54:54 +00:00
|
|
|
FILES= loader.help loader.4th support.4th loader.conf
|
2003-12-10 09:16:22 +00:00
|
|
|
FILESDIR_loader.conf= /boot/defaults
|
2000-10-16 10:46:22 +00:00
|
|
|
|
|
|
|
.if !exists(${DESTDIR}/boot/loader.rc)
|
2003-12-10 09:16:22 +00:00
|
|
|
FILES+= loader.rc
|
2000-10-16 10:46:22 +00:00
|
|
|
.endif
|
|
|
|
|
|
|
|
.include <bsd.prog.mk>
|