Makefile revision 222417
1# $FreeBSD: head/sys/boot/sparc64/loader/Makefile 222417 2011-05-28 08:50:38Z julian $
2
3.include <bsd.own.mk>
4MK_SSP=		no
5
6PROG=		loader
7NEWVERSWHAT=	"bootstrap loader" sparc64
8INSTALLFLAGS=	-b
9
10# Architecture-specific loader code
11SRCS=		locore.S main.c metadata.c vers.c
12
13LOADER_DISK_SUPPORT?=	yes
14LOADER_UFS_SUPPORT?=	yes
15LOADER_CD9660_SUPPORT?=	yes
16LOADER_NET_SUPPORT?=	yes
17LOADER_NFS_SUPPORT?=	yes
18LOADER_TFTP_SUPPORT?=	yes
19LOADER_GZIP_SUPPORT?=	yes
20LOADER_BZIP2_SUPPORT?=	no
21
22.if ${LOADER_DISK_SUPPORT} == "yes"
23CFLAGS+=	-DLOADER_DISK_SUPPORT
24.endif
25.if ${LOADER_UFS_SUPPORT} == "yes"
26CFLAGS+=	-DLOADER_UFS_SUPPORT
27.endif
28.if ${LOADER_CD9660_SUPPORT} == "yes"
29CFLAGS+=	-DLOADER_CD9660_SUPPORT
30.endif
31.if ${LOADER_GZIP_SUPPORT} == "yes"
32CFLAGS+=	-DLOADER_GZIP_SUPPORT
33.endif
34.if ${LOADER_BZIP2_SUPPORT} == "yes"
35CFLAGS+=	-DLOADER_BZIP2_SUPPORT
36.endif
37.if ${LOADER_NET_SUPPORT} == "yes"
38CFLAGS+=	-DLOADER_NET_SUPPORT
39.endif
40.if ${LOADER_NFS_SUPPORT} == "yes"
41CFLAGS+=	-DLOADER_NFS_SUPPORT
42.endif
43.if ${LOADER_TFTP_SUPPORT} == "yes"
44CFLAGS+=	-DLOADER_TFTP_SUPPORT
45.endif
46
47.if ${MK_FORTH} != "no"
48# Enable BootForth
49BOOT_FORTH=	yes
50CFLAGS+=	-DBOOT_FORTH -I${.CURDIR}/../../ficl -I${.CURDIR}/../../ficl/sparc64
51LIBFICL=	${.OBJDIR}/../../ficl/libficl.a
52.endif
53
54# Always add MI sources
55.PATH:		${.CURDIR}/../../common
56.include	"${.CURDIR}/../../common/Makefile.inc"
57CFLAGS+=	-I${.CURDIR}/../../common
58CFLAGS+=	-I.
59# Avoid the open-close-dance for every file access as some firmwares perform
60# an auto-negotiation on every open of the network interface and thus causes
61# netbooting to take horribly long.
62CFLAGS+=	-DNETIF_OPEN_CLOSE_ONCE
63
64CLEANFILES+=	vers.c loader.help
65
66LDFLAGS=	-static
67
68# Open Firmware standalone support library
69LIBOFW=		${.OBJDIR}/../../ofw/libofw/libofw.a
70CFLAGS+=	-I${.CURDIR}/../../ofw/libofw/
71
72# where to get libstand from
73CFLAGS+=	-I${.CURDIR}/../../../../lib/libstand/
74
75DPADD=		${LIBFICL} ${LIBOFW} ${LIBSTAND}
76LDADD=		${LIBFICL} ${LIBOFW} -lstand
77
78vers.c:	${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version
79	sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT}
80
81loader.help: help.common help.sparc64
82	cat ${.ALLSRC} | \
83	    awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET}
84
85.PATH: ${.CURDIR}/../../forth
86FILES=	loader.help loader.4th support.4th loader.conf
87FILES+=	beastie.4th brand.4th check-password.4th color.4th delay.4th
88FILES+= menu.4th menu-commands.4th shortcuts.4th version.4th
89FILESDIR_loader.conf=	/boot/defaults
90
91.if !exists(${DESTDIR}/boot/loader.rc)
92FILES+= loader.rc
93.endif
94
95.if !exists(${DESTDIR}/boot/menu.rc)
96FILES+= menu.rc
97.endif
98
99.include <bsd.prog.mk>
100