xref: /titanic_52/usr/src/boot/sys/boot/sparc64/loader/Makefile (revision 365903b555175a3c8539851beb68e9c8a1fd81f6)
1# $FreeBSD$
2
3.include <src.opts.mk>
4MK_SSP=		no
5MAN=
6
7PROG?=		loader
8NEWVERSWHAT?=	"bootstrap loader" sparc64
9INSTALLFLAGS=	-b
10
11# Architecture-specific loader code
12SRCS=		locore.S main.c metadata.c vers.c
13
14LOADER_DISK_SUPPORT?=	yes
15LOADER_UFS_SUPPORT?=	yes
16LOADER_CD9660_SUPPORT?=	yes
17LOADER_ZFS_SUPPORT?=	no
18LOADER_NET_SUPPORT?=	yes
19LOADER_NFS_SUPPORT?=	yes
20LOADER_TFTP_SUPPORT?=	yes
21LOADER_GZIP_SUPPORT?=	yes
22LOADER_BZIP2_SUPPORT?=	no
23LOADER_DEBUG?=		no
24
25.if ${LOADER_DEBUG} == "yes"
26CFLAGS+=	-DLOADER_DEBUG
27.endif
28.if ${LOADER_DISK_SUPPORT} == "yes"
29CFLAGS+=	-DLOADER_DISK_SUPPORT
30.endif
31.if ${LOADER_UFS_SUPPORT} == "yes"
32CFLAGS+=	-DLOADER_UFS_SUPPORT
33.endif
34.if ${LOADER_CD9660_SUPPORT} == "yes"
35CFLAGS+=	-DLOADER_CD9660_SUPPORT
36.endif
37.if ${LOADER_ZFS_SUPPORT} == "yes"
38CFLAGS+=	-DLOADER_ZFS_SUPPORT
39CFLAGS+=	-I${.CURDIR}/../../zfs
40CFLAGS+=	-I${.CURDIR}/../../../cddl/boot/zfs
41LIBZFSBOOT=	${.OBJDIR}/../../zfs/libzfsboot.a
42.endif
43.if ${LOADER_GZIP_SUPPORT} == "yes"
44CFLAGS+=	-DLOADER_GZIP_SUPPORT
45.endif
46.if ${LOADER_BZIP2_SUPPORT} == "yes"
47CFLAGS+=	-DLOADER_BZIP2_SUPPORT
48.endif
49.if ${LOADER_NET_SUPPORT} == "yes"
50CFLAGS+=	-DLOADER_NET_SUPPORT
51.endif
52.if ${LOADER_NFS_SUPPORT} == "yes"
53CFLAGS+=	-DLOADER_NFS_SUPPORT
54.endif
55.if ${LOADER_TFTP_SUPPORT} == "yes"
56CFLAGS+=	-DLOADER_TFTP_SUPPORT
57.endif
58
59.if ${MK_FORTH} != "no"
60# Enable BootForth
61BOOT_FORTH=	yes
62CFLAGS+=	-DBOOT_FORTH -I${.CURDIR}/../../ficl
63CFLAGS+=	-I${.CURDIR}/../../ficl/sparc64
64LIBFICL=	${.OBJDIR}/../../ficl/libficl.a
65.endif
66
67# Always add MI sources
68.PATH:		${.CURDIR}/../../common
69.include	"${.CURDIR}/../../common/Makefile.inc"
70CFLAGS+=	-I${.CURDIR}/../../common
71CFLAGS+=	-I.
72
73CLEANFILES+=	vers.c loader.help
74
75LDFLAGS=	-static
76
77# Open Firmware standalone support library
78LIBOFW=		${.OBJDIR}/../../ofw/libofw/libofw.a
79CFLAGS+=	-I${.CURDIR}/../../ofw/libofw/
80
81# where to get libstand from
82CFLAGS+=	-I${.CURDIR}/../../../../lib/libstand/
83
84DPADD=		${LIBFICL} ${LIBZFSBOOT} ${LIBOFW} ${LIBSTAND}
85LDADD=		${LIBFICL} ${LIBZFSBOOT} ${LIBOFW} -lstand
86
87vers.c:	${.CURDIR}/../../common/newvers.sh ${.CURDIR}/../loader/version
88	sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/../loader/version \
89	    ${NEWVERSWHAT}
90
91loader.help: help.common help.sparc64
92	cat ${.ALLSRC} | \
93	    awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET}
94
95.PATH: ${.CURDIR}/../../forth
96.include	"${.CURDIR}/../../forth/Makefile.inc"
97
98FILES+= loader.rc menu.rc
99
100.include <bsd.prog.mk>
101