Makefile revision 185375
1183878Sraj# $FreeBSD: head/sys/boot/arm/uboot/Makefile 185375 2008-11-27 16:53:01Z raj $
2183878Sraj
3183878SrajPROG=		ubldr
4183878SrajNEWVERSWHAT=	"U-Boot loader" ${MACHINE_ARCH}
5183878SrajBINDIR?=	/boot
6183878SrajINSTALLFLAGS=	-b
7183878SrajWARNS?=		1
8183878Sraj
9183878Sraj# Architecture-specific loader code
10183878SrajSRCS=		start.S conf.c vers.c
11183878Sraj
12185099SrajLOADER_DISK_SUPPORT?=	yes
13185099SrajLOADER_UFS_SUPPORT?=	yes
14183878SrajLOADER_CD9660_SUPPORT?=	no
15183878SrajLOADER_EXT2FS_SUPPORT?=	no
16183878SrajLOADER_NET_SUPPORT?=	yes
17183878SrajLOADER_NFS_SUPPORT?=	yes
18183878SrajLOADER_TFTP_SUPPORT?=	no
19183878SrajLOADER_GZIP_SUPPORT?=	no
20183878SrajLOADER_BZIP2_SUPPORT?=	no
21183878Sraj
22183878Sraj.if ${LOADER_DISK_SUPPORT} == "yes"
23183878SrajCFLAGS+=	-DLOADER_DISK_SUPPORT
24183878Sraj.endif
25183878Sraj.if ${LOADER_UFS_SUPPORT} == "yes"
26183878SrajCFLAGS+=	-DLOADER_UFS_SUPPORT
27183878Sraj.endif
28183878Sraj.if ${LOADER_CD9660_SUPPORT} == "yes"
29183878SrajCFLAGS+=	-DLOADER_CD9660_SUPPORT
30183878Sraj.endif
31183878Sraj.if ${LOADER_EXT2FS_SUPPORT} == "yes"
32183878SrajCFLAGS+=	-DLOADER_EXT2FS_SUPPORT
33183878Sraj.endif
34183878Sraj.if ${LOADER_GZIP_SUPPORT} == "yes"
35183878SrajCFLAGS+=	-DLOADER_GZIP_SUPPORT
36183878Sraj.endif
37183878Sraj.if ${LOADER_BZIP2_SUPPORT} == "yes"
38183878SrajCFLAGS+=	-DLOADER_BZIP2_SUPPORT
39183878Sraj.endif
40183878Sraj.if ${LOADER_NET_SUPPORT} == "yes"
41183878SrajCFLAGS+=	-DLOADER_NET_SUPPORT
42183878Sraj.endif
43183878Sraj.if ${LOADER_NFS_SUPPORT} == "yes"
44183878SrajCFLAGS+=	-DLOADER_NFS_SUPPORT
45183878Sraj.endif
46183878Sraj.if ${LOADER_TFTP_SUPPORT} == "yes"
47183878SrajCFLAGS+=	-DLOADER_TFTP_SUPPORT
48183878Sraj.endif
49183878Sraj
50183878Sraj.if !defined(NO_FORTH)
51183878Sraj# Enable BootForth
52183878SrajBOOT_FORTH=	yes
53183878SrajCFLAGS+=	-DBOOT_FORTH -I${.CURDIR}/../../ficl -I${.CURDIR}/../../ficl/arm
54183878SrajLIBFICL=	${.OBJDIR}/../../ficl/libficl.a
55183878Sraj.endif
56183878Sraj
57183878Sraj# Always add MI sources
58183878Sraj.PATH:		${.CURDIR}/../../common
59183878Sraj.include	"${.CURDIR}/../../common/Makefile.inc"
60183878SrajCFLAGS+=	-I${.CURDIR}/../../common
61183878SrajCFLAGS+=	-I.
62183878Sraj
63185375SrajCLEANFILES+=	vers.c loader.help
64183878Sraj
65183878SrajCFLAGS+=	-ffreestanding
66183878Sraj
67183878SrajLDFLAGS=	-nostdlib -static -T ${.CURDIR}/ldscript.arm
68183878Sraj
69183878Sraj# Pull in common loader code
70183878Sraj.PATH:		${.CURDIR}/../../uboot/common
71183878Sraj.include	"${.CURDIR}/../../uboot/common/Makefile.inc"
72183878SrajCFLAGS+=	-I${.CURDIR}/../../uboot/common
73183878Sraj
74183878Sraj# U-Boot standalone support library
75183878SrajLIBUBOOT=	${.OBJDIR}/../../uboot/lib/libuboot.a
76183878SrajCFLAGS+=	-I${.CURDIR}/../../uboot/lib
77183878SrajCFLAGS+=	-I${.OBJDIR}/../../uboot/lib
78183878Sraj
79183878Sraj# where to get libstand from
80183878SrajCFLAGS+=	-I${.CURDIR}/../../../../lib/libstand/
81183878Sraj
82183878SrajDPADD=		${LIBFICL} ${LIBUBOOT} ${LIBSTAND}
83183878SrajLDADD=		${LIBFICL} ${LIBUBOOT} -lstand
84183878Sraj
85183878Srajvers.c:	${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version
86183878Sraj	sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT}
87183878Sraj
88185375Srajloader.help: help.common help.uboot
89183878Sraj	cat ${.ALLSRC} | \
90183878Sraj	    awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET}
91183878Sraj
92183878Sraj.PATH: ${.CURDIR}/../../forth
93185375SrajFILES=	loader.help
94183878Sraj
95183878Sraj.include <bsd.prog.mk>
96