Makefile revision 176349
1176349Smarcel# $FreeBSD: head/sys/boot/powerpc/uboot/Makefile 176349 2008-02-16 22:40:55Z marcel $
2176349Smarcel
3176349SmarcelPROG=		loader
4176349SmarcelNEWVERSWHAT=	"U-Boot loader" ${MACHINE_ARCH}
5176349SmarcelBINDIR?=	/boot
6176349SmarcelINSTALLFLAGS=	-b
7176349Smarcel
8176349Smarcel# Architecture-specific loader code
9176349SmarcelSRCS=		start.S conf.c metadata.c vers.c
10176349Smarcel
11176349SmarcelLOADER_DISK_SUPPORT?=	no
12176349SmarcelLOADER_UFS_SUPPORT?=	no
13176349SmarcelLOADER_CD9660_SUPPORT?=	no
14176349SmarcelLOADER_EXT2FS_SUPPORT?=	no
15176349SmarcelLOADER_NET_SUPPORT?=	yes
16176349SmarcelLOADER_NFS_SUPPORT?=	yes
17176349SmarcelLOADER_TFTP_SUPPORT?=	no
18176349SmarcelLOADER_GZIP_SUPPORT?=	no
19176349SmarcelLOADER_BZIP2_SUPPORT?=	no
20176349Smarcel
21176349Smarcel.if ${LOADER_DISK_SUPPORT} == "yes"
22176349SmarcelCFLAGS+=	-DLOADER_DISK_SUPPORT
23176349Smarcel.endif
24176349Smarcel.if ${LOADER_UFS_SUPPORT} == "yes"
25176349SmarcelCFLAGS+=	-DLOADER_UFS_SUPPORT
26176349Smarcel.endif
27176349Smarcel.if ${LOADER_CD9660_SUPPORT} == "yes"
28176349SmarcelCFLAGS+=	-DLOADER_CD9660_SUPPORT
29176349Smarcel.endif
30176349Smarcel.if ${LOADER_EXT2FS_SUPPORT} == "yes"
31176349SmarcelCFLAGS+=	-DLOADER_EXT2FS_SUPPORT
32176349Smarcel.endif
33176349Smarcel.if ${LOADER_GZIP_SUPPORT} == "yes"
34176349SmarcelCFLAGS+=	-DLOADER_GZIP_SUPPORT
35176349Smarcel.endif
36176349Smarcel.if ${LOADER_BZIP2_SUPPORT} == "yes"
37176349SmarcelCFLAGS+=	-DLOADER_BZIP2_SUPPORT
38176349Smarcel.endif
39176349Smarcel.if ${LOADER_NET_SUPPORT} == "yes"
40176349SmarcelCFLAGS+=	-DLOADER_NET_SUPPORT
41176349Smarcel.endif
42176349Smarcel.if ${LOADER_NFS_SUPPORT} == "yes"
43176349SmarcelCFLAGS+=	-DLOADER_NFS_SUPPORT
44176349Smarcel.endif
45176349Smarcel.if ${LOADER_TFTP_SUPPORT} == "yes"
46176349SmarcelCFLAGS+=	-DLOADER_TFTP_SUPPORT
47176349Smarcel.endif
48176349Smarcel
49176349Smarcel.if !defined(NO_FORTH)
50176349Smarcel# Enable BootForth
51176349SmarcelBOOT_FORTH=	yes
52176349SmarcelCFLAGS+=	-DBOOT_FORTH -I${.CURDIR}/../../ficl -I${.CURDIR}/../../ficl/powerpc
53176349SmarcelLIBFICL=	${.OBJDIR}/../../ficl/libficl.a
54176349Smarcel.endif
55176349Smarcel
56176349Smarcel# Always add MI sources
57176349Smarcel.PATH:		${.CURDIR}/../../common
58176349Smarcel.include	"${.CURDIR}/../../common/Makefile.inc"
59176349SmarcelCFLAGS+=	-I${.CURDIR}/../../common
60176349SmarcelCFLAGS+=	-I.
61176349Smarcel
62176349SmarcelCLEANFILES+=	vers.c loader.help
63176349Smarcel
64176349SmarcelCFLAGS+=	-ffreestanding
65176349Smarcel
66176349SmarcelLDFLAGS=	-nostdlib -static -T ${.CURDIR}/ldscript.powerpc
67176349Smarcel
68176349Smarcel# Pull in common loader code
69176349Smarcel.PATH:		${.CURDIR}/../../uboot/common
70176349Smarcel.include	"${.CURDIR}/../../uboot/common/Makefile.inc"
71176349SmarcelCFLAGS+=	-I${.CURDIR}/../../uboot/common
72176349Smarcel
73176349Smarcel# U-Boot standalone support library
74176349SmarcelLIBUBOOT=	${.OBJDIR}/../../uboot/lib/libuboot.a
75176349SmarcelCFLAGS+=	-I${.CURDIR}/../../uboot/lib
76176349SmarcelCFLAGS+=	-I${.OBJDIR}/../../uboot/lib
77176349Smarcel
78176349Smarcel# where to get libstand from
79176349SmarcelCFLAGS+=	-I${.CURDIR}/../../../../lib/libstand/
80176349Smarcel
81176349SmarcelDPADD=		${LIBFICL} ${LIBUBOOT} ${LIBSTAND}
82176349SmarcelLDADD=		${LIBFICL} ${LIBUBOOT} -lstand
83176349Smarcel
84176349Smarcelvers.c:	${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version
85176349Smarcel	sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT}
86176349Smarcel
87176349Smarcelloader.help: help.common help.uboot
88176349Smarcel	cat ${.ALLSRC} | \
89176349Smarcel	    awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET}
90176349Smarcel
91176349Smarcel.PATH: ${.CURDIR}/../../forth
92176349SmarcelFILES=	loader.help loader.4th support.4th loader.conf
93176349SmarcelFILESDIR_loader.conf=	/boot/defaults
94176349Smarcel
95176349Smarcel.if !exists(${DESTDIR}/boot/loader.rc)
96176349SmarcelFILES+= loader.rc
97176349Smarcel.endif
98176349Smarcel
99176349Smarcel.include <bsd.prog.mk>
100