Makefile revision 99560
1# $FreeBSD: head/sys/boot/sparc64/loader/Makefile 99560 2002-07-07 23:08:22Z jake $
2
3BASE=		loader
4PROG=		${BASE}
5STRIP=
6NEWVERSWHAT=	"bootstrap loader" sparc64
7BINDIR?=	/boot
8INSTALLFLAGS=	-b
9NOFORTH=	yes
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_NET_SUPPORT?=	yes
18LOADER_NFS_SUPPORT?=	yes
19LOADER_TFTP_SUPPORT?=	yes
20
21.if ${LOADER_DISK_SUPPORT} == "yes"
22CFLAGS+=	-DLOADER_DISK_SUPPORT
23.endif
24.if ${LOADER_UFS_SUPPORT} == "yes"
25CFLAGS+=	-DLOADER_UFS_SUPPORT
26.endif
27.if ${LOADER_CD9660_SUPPORT} == "yes"
28CFLAGS+=	-DLOADER_CD9660_SUPPORT
29.endif
30.if ${LOADER_NET_SUPPORT} == "yes"
31CFLAGS+=	-DLOADER_NET_SUPPORT
32.endif
33.if ${LOADER_NFS_SUPPORT} == "yes"
34CFLAGS+=	-DLOADER_NFS_SUPPORT
35.endif
36.if ${LOADER_TFTP_SUPPORT} == "yes"
37CFLAGS+=	-DLOADER_TFTP_SUPPORT
38.endif
39
40.if !defined(NOFORTH)
41# Enable BootForth
42BOOT_FORTH=	yes
43CFLAGS+=	-DBOOT_FORTH -I${.CURDIR}/../../ficl -I${.CURDIR}/../../ficl/sparc64
44.if exists(${.OBJDIR}/../../ficl/libficl.a)
45LIBFICL=	${.OBJDIR}/../../ficl/libficl.a
46.else
47LIBFICL=	${.CURDIR}/../../ficl/libficl.a
48.endif
49.endif
50
51# Always add MI sources 
52.PATH:		${.CURDIR}/../../common
53.include	<${.CURDIR}/../../common/Makefile.inc>
54CFLAGS+=	-I${.CURDIR}/../../common
55CFLAGS+=	-I${.CURDIR}/../../.. -I.
56
57CLEANFILES+=	vers.c ${BASE}.help
58
59CFLAGS+=	-ffreestanding
60LDFLAGS=	-nostdlib -static
61
62# Openfirmware standalone support library
63LIBOFW=		${.OBJDIR}/../../ofw/libofw/libofw.a
64CFLAGS+=	-I${.CURDIR}/../../ofw/libofw/
65
66# where to get libstand from
67#XXX need a better way to do this
68LIBSTAND=	${.CURDIR}/../../../../lib/libstand/libstand.a
69.if !exists(${LIBSTAND})
70LIBSTAND=	${.OBJDIR}/../../../../lib/libstand/libstand.a
71.if !exists(${LIBSTAND})
72LIBSTAND=	-lstand
73.endif
74.endif
75CFLAGS+=	-I${.CURDIR}/../../../../lib/libstand/
76
77LDADD=		${LIBFICL} ${LIBSTAND} ${LIBOFW}
78
79vers.c:	${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version
80	sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT}
81
82${BASE}.help: help.common help.sparc64
83	cat ${.ALLSRC} | \
84	    awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET}
85
86.PATH: ${.CURDIR}/../../forth
87FILES=	${BASE}.help loader.4th support.4th loader.conf
88FILESDIR_loader.conf=	/boot/defaults
89
90.if !exists(${DESTDIR}/boot/loader.rc)
91FILES+= loader.rc
92.endif
93
94# There are no things relevant to all boot parts of FreeBSD/sparc64 yet.
95#.include <${.CURDIR}/../Makefile.inc>
96
97.include <bsd.prog.mk>
98
99.if exists(${.CURDIR}/../../../sparc64/include)
100beforedepend ${OBJS}: machine
101
102machine:
103	ln -sf ${.CURDIR}/../../../sparc64/include machine
104.endif
105
106CLEANFILES+=	machine
107