xref: /titanic_52/usr/src/boot/sys/boot/sparc64/loader/Makefile (revision 4a5d661a82b942b6538acd26209d959ce98b593a)
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# Avoid the open-close-dance for every file access as some firmwares perform
73# an auto-negotiation on every open of the network interface and thus causes
74# netbooting to take horribly long.
75CFLAGS+=	-DNETIF_OPEN_CLOSE_ONCE
76
77CLEANFILES+=	vers.c loader.help
78
79LDFLAGS=	-static
80
81# Open Firmware standalone support library
82LIBOFW=		${.OBJDIR}/../../ofw/libofw/libofw.a
83CFLAGS+=	-I${.CURDIR}/../../ofw/libofw/
84
85# where to get libstand from
86CFLAGS+=	-I${.CURDIR}/../../../../lib/libstand/
87
88DPADD=		${LIBFICL} ${LIBZFSBOOT} ${LIBOFW} ${LIBSTAND}
89LDADD=		${LIBFICL} ${LIBZFSBOOT} ${LIBOFW} -lstand
90
91vers.c:	${.CURDIR}/../../common/newvers.sh ${.CURDIR}/../loader/version
92	sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/../loader/version \
93	    ${NEWVERSWHAT}
94
95loader.help: help.common help.sparc64
96	cat ${.ALLSRC} | \
97	    awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET}
98
99.PATH: ${.CURDIR}/../../forth
100.include	"${.CURDIR}/../../forth/Makefile.inc"
101
102FILES+= loader.rc menu.rc
103
104.include <bsd.prog.mk>
105