2001-10-15 10:36:35 +00:00
|
|
|
# $FreeBSD$
|
|
|
|
|
|
|
|
BASE= loader
|
|
|
|
PROG= ${BASE}
|
|
|
|
NEWVERSWHAT= "bootstrap loader" sparc64
|
2002-04-02 17:08:37 +00:00
|
|
|
BINDIR?= /boot
|
|
|
|
INSTALLFLAGS= -b
|
2001-10-15 10:36:35 +00:00
|
|
|
|
2002-02-23 04:35:28 +00:00
|
|
|
CFLAGS= -mno-app-regs
|
|
|
|
|
2002-04-02 17:08:37 +00:00
|
|
|
LOADER_DISK_SUPPORT?= yes
|
|
|
|
LOADER_UFS_SUPPORT?= yes
|
2002-04-01 23:28:35 +00:00
|
|
|
LOADER_CD9660_SUPPORT?= no
|
2002-04-02 17:08:37 +00:00
|
|
|
LOADER_NET_SUPPORT?= no
|
|
|
|
LOADER_NFS_SUPPORT?= no
|
|
|
|
LOADER_TFTP_SUPPORT?= no
|
2002-02-23 04:35:28 +00:00
|
|
|
|
|
|
|
.if ${LOADER_DISK_SUPPORT} == "yes"
|
|
|
|
CFLAGS+= -DLOADER_DISK_SUPPORT
|
|
|
|
.endif
|
2002-04-01 23:28:35 +00:00
|
|
|
.if ${LOADER_UFS_SUPPORT} == "yes"
|
|
|
|
CFLAGS+= -DLOADER_UFS_SUPPORT
|
|
|
|
.endif
|
|
|
|
.if ${LOADER_CD9660_SUPPORT} == "yes"
|
|
|
|
CFLAGS+= -DLOADER_CD9660_SUPPORT
|
|
|
|
.endif
|
2002-02-23 04:35:28 +00:00
|
|
|
.if ${LOADER_NET_SUPPORT} == "yes"
|
|
|
|
CFLAGS+= -DLOADER_NET_SUPPORT
|
|
|
|
.endif
|
|
|
|
.if ${LOADER_NFS_SUPPORT} == "yes"
|
|
|
|
CFLAGS+= -DLOADER_NFS_SUPPORT
|
|
|
|
.endif
|
|
|
|
.if ${LOADER_TFTP_SUPPORT} == "yes"
|
|
|
|
CFLAGS+= -DLOADER_TFTP_SUPPORT
|
|
|
|
.endif
|
2001-10-30 06:37:36 +00:00
|
|
|
|
2001-10-15 10:36:35 +00:00
|
|
|
# Architecture-specific loader code
|
2002-04-02 17:08:37 +00:00
|
|
|
SRCS= locore.S main.c metadata.c
|
2001-10-15 10:36:35 +00:00
|
|
|
|
|
|
|
# Always add MI sources
|
|
|
|
.PATH: ${.CURDIR}/../../common
|
|
|
|
.include <${.CURDIR}/../../common/Makefile.inc>
|
|
|
|
CFLAGS+= -I${.CURDIR}/../../common
|
|
|
|
CFLAGS+= -I${.CURDIR}/../../.. -I.
|
|
|
|
|
2002-04-02 17:08:37 +00:00
|
|
|
CLEANFILES+= ${PROG}.help
|
2001-10-15 10:36:35 +00:00
|
|
|
|
2002-05-10 09:26:35 +00:00
|
|
|
CFLAGS+= -ffreestanding
|
2002-04-02 17:08:37 +00:00
|
|
|
LDFLAGS= -nostdlib -static
|
|
|
|
LDADD= ${LIBSTAND} ${LIBOFW}
|
2001-10-15 10:36:35 +00:00
|
|
|
|
|
|
|
# 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
|
2002-04-02 17:08:37 +00:00
|
|
|
LIBOFW= ${.OBJDIR}/../../ofw/libofw/libofw.a
|
2001-10-15 10:36:35 +00:00
|
|
|
CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/
|
|
|
|
CFLAGS+= -I${.CURDIR}/../../ofw/libofw/
|
|
|
|
|
2002-04-02 17:08:37 +00:00
|
|
|
${BASE}.help: help.common help.sparc64
|
|
|
|
cat ${.ALLSRC} | \
|
|
|
|
awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET}
|
2001-10-15 10:36:35 +00:00
|
|
|
|
2002-04-02 17:08:37 +00:00
|
|
|
beforeinstall: ${PROG}.help
|
2001-10-15 10:36:35 +00:00
|
|
|
.if exists(${DESTDIR}/boot/loader)
|
|
|
|
mv ${DESTDIR}/boot/loader ${DESTDIR}/boot/loader.old
|
|
|
|
.endif
|
2002-04-02 17:08:37 +00:00
|
|
|
#.if exists(${.OBJDIR}/loader.help)
|
2001-10-15 10:36:35 +00:00
|
|
|
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
|
|
|
|
${.OBJDIR}/${BASE}.help ${DESTDIR}/boot
|
2002-04-02 17:08:37 +00:00
|
|
|
#.else
|
|
|
|
# ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
|
|
|
|
# ${.CURDIR}/${BASE}.help ${DESTDIR}/boot
|
|
|
|
#.endif
|
2001-10-15 10:36:35 +00:00
|
|
|
.if !exists(${DESTDIR}/boot/loader.rc)
|
|
|
|
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
|
|
|
|
${.CURDIR}/../../forth/loader.rc ${DESTDIR}/boot
|
|
|
|
.endif
|
|
|
|
${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
|
|
|
|
|
|
|
|
# There are no things relevant to all boot parts of FreeBSD/sparc64 yet.
|
|
|
|
#.include <${.CURDIR}/../Makefile.inc>
|
|
|
|
|
|
|
|
.include <bsd.prog.mk>
|