199767f8919635c4928607450d9e0abb932109ceToomas Soome# $FreeBSD$
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soome.include <src.opts.mk>
199767f8919635c4928607450d9e0abb932109ceToomas SoomeMK_SSP= no
199767f8919635c4928607450d9e0abb932109ceToomas SoomeMAN=
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas SoomePROG?= loader
199767f8919635c4928607450d9e0abb932109ceToomas SoomeNEWVERSWHAT?= "bootstrap loader" sparc64
199767f8919635c4928607450d9e0abb932109ceToomas SoomeINSTALLFLAGS= -b
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soome# Architecture-specific loader code
199767f8919635c4928607450d9e0abb932109ceToomas SoomeSRCS= locore.S main.c metadata.c vers.c
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas SoomeLOADER_DISK_SUPPORT?= yes
199767f8919635c4928607450d9e0abb932109ceToomas SoomeLOADER_UFS_SUPPORT?= yes
199767f8919635c4928607450d9e0abb932109ceToomas SoomeLOADER_CD9660_SUPPORT?= yes
199767f8919635c4928607450d9e0abb932109ceToomas SoomeLOADER_ZFS_SUPPORT?= no
199767f8919635c4928607450d9e0abb932109ceToomas SoomeLOADER_NET_SUPPORT?= yes
199767f8919635c4928607450d9e0abb932109ceToomas SoomeLOADER_NFS_SUPPORT?= yes
199767f8919635c4928607450d9e0abb932109ceToomas SoomeLOADER_TFTP_SUPPORT?= yes
199767f8919635c4928607450d9e0abb932109ceToomas SoomeLOADER_GZIP_SUPPORT?= yes
199767f8919635c4928607450d9e0abb932109ceToomas SoomeLOADER_BZIP2_SUPPORT?= no
199767f8919635c4928607450d9e0abb932109ceToomas SoomeLOADER_DEBUG?= no
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soome.if ${LOADER_DEBUG} == "yes"
199767f8919635c4928607450d9e0abb932109ceToomas SoomeCFLAGS+= -DLOADER_DEBUG
199767f8919635c4928607450d9e0abb932109ceToomas Soome.endif
199767f8919635c4928607450d9e0abb932109ceToomas Soome.if ${LOADER_DISK_SUPPORT} == "yes"
199767f8919635c4928607450d9e0abb932109ceToomas SoomeCFLAGS+= -DLOADER_DISK_SUPPORT
199767f8919635c4928607450d9e0abb932109ceToomas Soome.endif
199767f8919635c4928607450d9e0abb932109ceToomas Soome.if ${LOADER_UFS_SUPPORT} == "yes"
199767f8919635c4928607450d9e0abb932109ceToomas SoomeCFLAGS+= -DLOADER_UFS_SUPPORT
199767f8919635c4928607450d9e0abb932109ceToomas Soome.endif
199767f8919635c4928607450d9e0abb932109ceToomas Soome.if ${LOADER_CD9660_SUPPORT} == "yes"
199767f8919635c4928607450d9e0abb932109ceToomas SoomeCFLAGS+= -DLOADER_CD9660_SUPPORT
199767f8919635c4928607450d9e0abb932109ceToomas Soome.endif
199767f8919635c4928607450d9e0abb932109ceToomas Soome.if ${LOADER_ZFS_SUPPORT} == "yes"
199767f8919635c4928607450d9e0abb932109ceToomas SoomeCFLAGS+= -DLOADER_ZFS_SUPPORT
199767f8919635c4928607450d9e0abb932109ceToomas SoomeCFLAGS+= -I${.CURDIR}/../../zfs
199767f8919635c4928607450d9e0abb932109ceToomas SoomeCFLAGS+= -I${.CURDIR}/../../../cddl/boot/zfs
199767f8919635c4928607450d9e0abb932109ceToomas SoomeLIBZFSBOOT= ${.OBJDIR}/../../zfs/libzfsboot.a
199767f8919635c4928607450d9e0abb932109ceToomas Soome.endif
199767f8919635c4928607450d9e0abb932109ceToomas Soome.if ${LOADER_GZIP_SUPPORT} == "yes"
199767f8919635c4928607450d9e0abb932109ceToomas SoomeCFLAGS+= -DLOADER_GZIP_SUPPORT
199767f8919635c4928607450d9e0abb932109ceToomas Soome.endif
199767f8919635c4928607450d9e0abb932109ceToomas Soome.if ${LOADER_BZIP2_SUPPORT} == "yes"
199767f8919635c4928607450d9e0abb932109ceToomas SoomeCFLAGS+= -DLOADER_BZIP2_SUPPORT
199767f8919635c4928607450d9e0abb932109ceToomas Soome.endif
199767f8919635c4928607450d9e0abb932109ceToomas Soome.if ${LOADER_NET_SUPPORT} == "yes"
199767f8919635c4928607450d9e0abb932109ceToomas SoomeCFLAGS+= -DLOADER_NET_SUPPORT
199767f8919635c4928607450d9e0abb932109ceToomas Soome.endif
199767f8919635c4928607450d9e0abb932109ceToomas Soome.if ${LOADER_NFS_SUPPORT} == "yes"
199767f8919635c4928607450d9e0abb932109ceToomas SoomeCFLAGS+= -DLOADER_NFS_SUPPORT
199767f8919635c4928607450d9e0abb932109ceToomas Soome.endif
199767f8919635c4928607450d9e0abb932109ceToomas Soome.if ${LOADER_TFTP_SUPPORT} == "yes"
199767f8919635c4928607450d9e0abb932109ceToomas SoomeCFLAGS+= -DLOADER_TFTP_SUPPORT
199767f8919635c4928607450d9e0abb932109ceToomas Soome.endif
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soome.if ${MK_FORTH} != "no"
199767f8919635c4928607450d9e0abb932109ceToomas Soome# Enable BootForth
199767f8919635c4928607450d9e0abb932109ceToomas SoomeBOOT_FORTH= yes
199767f8919635c4928607450d9e0abb932109ceToomas SoomeCFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../../ficl
199767f8919635c4928607450d9e0abb932109ceToomas SoomeCFLAGS+= -I${.CURDIR}/../../ficl/sparc64
199767f8919635c4928607450d9e0abb932109ceToomas SoomeLIBFICL= ${.OBJDIR}/../../ficl/libficl.a
199767f8919635c4928607450d9e0abb932109ceToomas Soome.endif
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soome# Always add MI sources
199767f8919635c4928607450d9e0abb932109ceToomas Soome.PATH: ${.CURDIR}/../../common
199767f8919635c4928607450d9e0abb932109ceToomas Soome.include "${.CURDIR}/../../common/Makefile.inc"
199767f8919635c4928607450d9e0abb932109ceToomas SoomeCFLAGS+= -I${.CURDIR}/../../common
199767f8919635c4928607450d9e0abb932109ceToomas SoomeCFLAGS+= -I.
199767f8919635c4928607450d9e0abb932109ceToomas Soome# Avoid the open-close-dance for every file access as some firmwares perform
199767f8919635c4928607450d9e0abb932109ceToomas Soome# an auto-negotiation on every open of the network interface and thus causes
199767f8919635c4928607450d9e0abb932109ceToomas Soome# netbooting to take horribly long.
199767f8919635c4928607450d9e0abb932109ceToomas SoomeCFLAGS+= -DNETIF_OPEN_CLOSE_ONCE
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas SoomeCLEANFILES+= vers.c loader.help
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas SoomeLDFLAGS= -static
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soome# Open Firmware standalone support library
199767f8919635c4928607450d9e0abb932109ceToomas SoomeLIBOFW= ${.OBJDIR}/../../ofw/libofw/libofw.a
199767f8919635c4928607450d9e0abb932109ceToomas SoomeCFLAGS+= -I${.CURDIR}/../../ofw/libofw/
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soome# where to get libstand from
199767f8919635c4928607450d9e0abb932109ceToomas SoomeCFLAGS+= -I${.CURDIR}/../../../../lib/libstand/
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas SoomeDPADD= ${LIBFICL} ${LIBZFSBOOT} ${LIBOFW} ${LIBSTAND}
199767f8919635c4928607450d9e0abb932109ceToomas SoomeLDADD= ${LIBFICL} ${LIBZFSBOOT} ${LIBOFW} -lstand
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soomevers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/../loader/version
199767f8919635c4928607450d9e0abb932109ceToomas Soome sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/../loader/version \
199767f8919635c4928607450d9e0abb932109ceToomas Soome ${NEWVERSWHAT}
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soomeloader.help: help.common help.sparc64
199767f8919635c4928607450d9e0abb932109ceToomas Soome cat ${.ALLSRC} | \
199767f8919635c4928607450d9e0abb932109ceToomas Soome awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET}
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soome.PATH: ${.CURDIR}/../../forth
199767f8919635c4928607450d9e0abb932109ceToomas Soome.include "${.CURDIR}/../../forth/Makefile.inc"
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas SoomeFILES+= loader.rc menu.rc
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soome.include <bsd.prog.mk>