Makefile revision 99541
184974Srobert# $FreeBSD: head/sys/boot/sparc64/loader/Makefile 99541 2002-07-07 18:23:10Z jake $
284974Srobert
384974SrobertBASE=		loader
484974SrobertPROG=		${BASE}
597432SjakeSTRIP=
684974SrobertNEWVERSWHAT=	"bootstrap loader" sparc64
793677StmmBINDIR?=	/boot
893677StmmINSTALLFLAGS=	-b
997432SjakeNOFORTH=	yes
1084974Srobert
1197432Sjake# Architecture-specific loader code
1299541SjakeSRCS=		locore.S main.c metadata.c vers.c
1385720Sjake
1493677StmmLOADER_DISK_SUPPORT?=	yes
1593677StmmLOADER_UFS_SUPPORT?=	yes
1698594SjakeLOADER_CD9660_SUPPORT?=	yes
1793677StmmLOADER_NET_SUPPORT?=	no
1893677StmmLOADER_NFS_SUPPORT?=	no
1993677StmmLOADER_TFTP_SUPPORT?=	no
2091114Sjake
2191114Sjake.if ${LOADER_DISK_SUPPORT} == "yes"
2291114SjakeCFLAGS+=	-DLOADER_DISK_SUPPORT
2391114Sjake.endif
2493606Stmm.if ${LOADER_UFS_SUPPORT} == "yes"
2593606StmmCFLAGS+=	-DLOADER_UFS_SUPPORT
2693606Stmm.endif
2793606Stmm.if ${LOADER_CD9660_SUPPORT} == "yes"
2893606StmmCFLAGS+=	-DLOADER_CD9660_SUPPORT
2993606Stmm.endif
3091114Sjake.if ${LOADER_NET_SUPPORT} == "yes"
3191114SjakeCFLAGS+=	-DLOADER_NET_SUPPORT
3291114Sjake.endif
3391114Sjake.if ${LOADER_NFS_SUPPORT} == "yes"
3491114SjakeCFLAGS+=	-DLOADER_NFS_SUPPORT
3591114Sjake.endif
3691114Sjake.if ${LOADER_TFTP_SUPPORT} == "yes"
3791114SjakeCFLAGS+=	-DLOADER_TFTP_SUPPORT
3891114Sjake.endif
3991114Sjake
4097432Sjake.if !defined(NOFORTH)
4197432Sjake# Enable BootForth
4297432SjakeBOOT_FORTH=	yes
4397432SjakeCFLAGS+=	-DBOOT_FORTH -I${.CURDIR}/../../ficl -I${.CURDIR}/../../ficl/sparc64
4497432Sjake.if exists(${.OBJDIR}/../../ficl/libficl.a)
4597432SjakeLIBFICL=	${.OBJDIR}/../../ficl/libficl.a
4697432Sjake.else
4797432SjakeLIBFICL=	${.CURDIR}/../../ficl/libficl.a
4897432Sjake.endif
4997432Sjake.endif
5084974Srobert
5184974Srobert# Always add MI sources 
5284974Srobert.PATH:		${.CURDIR}/../../common
5384974Srobert.include	<${.CURDIR}/../../common/Makefile.inc>
5484974SrobertCFLAGS+=	-I${.CURDIR}/../../common
5584974SrobertCFLAGS+=	-I${.CURDIR}/../../.. -I.
5684974Srobert
5799541SjakeCLEANFILES+=	vers.c ${BASE}.help
5884974Srobert
5996342SobrienCFLAGS+=	-ffreestanding
6093677StmmLDFLAGS=	-nostdlib -static
6184974Srobert
6297432Sjake# Openfirmware standalone support library
6397432SjakeLIBOFW=		${.OBJDIR}/../../ofw/libofw/libofw.a
6497432SjakeCFLAGS+=	-I${.CURDIR}/../../ofw/libofw/
6597432Sjake
6684974Srobert# where to get libstand from
6784974Srobert#XXX need a better way to do this
6884974SrobertLIBSTAND=	${.CURDIR}/../../../../lib/libstand/libstand.a
6984974Srobert.if !exists(${LIBSTAND})
7084974SrobertLIBSTAND=	${.OBJDIR}/../../../../lib/libstand/libstand.a
7184974Srobert.if !exists(${LIBSTAND})
7284974SrobertLIBSTAND=	-lstand
7384974Srobert.endif
7484974Srobert.endif
7584974SrobertCFLAGS+=	-I${.CURDIR}/../../../../lib/libstand/
7684974Srobert
7799541SjakeLDADD=		${LIBFICL} ${LIBSTAND} ${LIBOFW}
7897432Sjake
7999541Sjakevers.c:	${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version
8097432Sjake	sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT}
8197432Sjake
8293677Stmm${BASE}.help: help.common help.sparc64
8393677Stmm	cat ${.ALLSRC} | \
8493677Stmm	    awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET}
8584974Srobert
8697432Sjake.PATH: ${.CURDIR}/../../forth
8797432SjakeFILES=	${BASE}.help loader.4th support.4th loader.conf
8897432SjakeFILESDIR_loader.conf=	/boot/defaults
8997432Sjake
9084974Srobert.if !exists(${DESTDIR}/boot/loader.rc)
9197432SjakeFILES+= loader.rc
9284974Srobert.endif
9384974Srobert
9484974Srobert# There are no things relevant to all boot parts of FreeBSD/sparc64 yet.
9584974Srobert#.include <${.CURDIR}/../Makefile.inc>
9684974Srobert
9784974Srobert.include <bsd.prog.mk>
9897432Sjake
9997432Sjake.if exists(${.CURDIR}/../../../sparc64/include)
10097432Sjakebeforedepend ${OBJS}: machine
10197432Sjake
10297432Sjakemachine:
10397432Sjake	ln -sf ${.CURDIR}/../../../sparc64/include machine
10497432Sjake.endif
10597432Sjake
10697432SjakeCLEANFILES+=	machine
107