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