Makefile revision 235537
1# $FreeBSD: head/sys/boot/arm/uboot/Makefile 235537 2012-05-17 10:11:18Z gber $
2
3.include <bsd.own.mk>
4
5PROG=		ubldr
6NEWVERSWHAT=	"U-Boot loader" ${MACHINE_ARCH}
7BINDIR?=	/boot
8INSTALLFLAGS=	-b
9WARNS?=		1
10
11# Architecture-specific loader code
12SRCS=		start.S conf.c vers.c
13
14LOADER_DISK_SUPPORT?=	yes
15LOADER_UFS_SUPPORT?=	yes
16LOADER_CD9660_SUPPORT?=	no
17LOADER_EXT2FS_SUPPORT?=	no
18.if ${MK_NAND} != "no"
19LOADER_NANDFS_SUPPORT?= yes
20.else
21LOADER_NANDFS_SUPPORT?= no
22.endif
23LOADER_NET_SUPPORT?=	yes
24LOADER_NFS_SUPPORT?=	yes
25LOADER_TFTP_SUPPORT?=	no
26LOADER_GZIP_SUPPORT?=	no
27LOADER_BZIP2_SUPPORT?=	no
28.if ${MK_FDT} != "no"
29LOADER_FDT_SUPPORT=	yes
30.else
31LOADER_FDT_SUPPORT=	no
32.endif
33
34.if ${LOADER_DISK_SUPPORT} == "yes"
35CFLAGS+=	-DLOADER_DISK_SUPPORT
36.endif
37.if ${LOADER_UFS_SUPPORT} == "yes"
38CFLAGS+=	-DLOADER_UFS_SUPPORT
39.endif
40.if ${LOADER_CD9660_SUPPORT} == "yes"
41CFLAGS+=	-DLOADER_CD9660_SUPPORT
42.endif
43.if ${LOADER_EXT2FS_SUPPORT} == "yes"
44CFLAGS+=	-DLOADER_EXT2FS_SUPPORT
45.endif
46.if ${LOADER_NANDFS_SUPPORT} == "yes"
47CFLAGS+=	-DLOADER_NANDFS_SUPPORT
48.endif
49.if ${LOADER_GZIP_SUPPORT} == "yes"
50CFLAGS+=	-DLOADER_GZIP_SUPPORT
51.endif
52.if ${LOADER_BZIP2_SUPPORT} == "yes"
53CFLAGS+=	-DLOADER_BZIP2_SUPPORT
54.endif
55.if ${LOADER_NET_SUPPORT} == "yes"
56CFLAGS+=	-DLOADER_NET_SUPPORT
57.endif
58.if ${LOADER_NFS_SUPPORT} == "yes"
59CFLAGS+=	-DLOADER_NFS_SUPPORT
60.endif
61.if ${LOADER_TFTP_SUPPORT} == "yes"
62CFLAGS+=	-DLOADER_TFTP_SUPPORT
63.endif
64.if ${LOADER_FDT_SUPPORT} == "yes"
65CFLAGS+=	-I${.CURDIR}/../../fdt
66CFLAGS+=	-I${.OBJDIR}/../../fdt
67CFLAGS+=	-DLOADER_FDT_SUPPORT
68LIBFDT=		${.OBJDIR}/../../fdt/libfdt.a
69.endif
70
71.if !defined(NO_FORTH)
72# Enable BootForth
73BOOT_FORTH=	yes
74CFLAGS+=	-DBOOT_FORTH -I${.CURDIR}/../../ficl -I${.CURDIR}/../../ficl/arm
75LIBFICL=	${.OBJDIR}/../../ficl/libficl.a
76.endif
77
78# Always add MI sources
79.PATH:		${.CURDIR}/../../common
80.include	"${.CURDIR}/../../common/Makefile.inc"
81CFLAGS+=	-I${.CURDIR}/../../common
82CFLAGS+=	-I.
83
84CLEANFILES+=	vers.c loader.help
85
86CFLAGS+=	-ffreestanding
87
88LDFLAGS=	-nostdlib -static -T ${.CURDIR}/ldscript.${MACHINE_CPUARCH}
89
90# Pull in common loader code
91.PATH:		${.CURDIR}/../../uboot/common
92.include	"${.CURDIR}/../../uboot/common/Makefile.inc"
93CFLAGS+=	-I${.CURDIR}/../../uboot/common
94
95# U-Boot standalone support library
96LIBUBOOT=	${.OBJDIR}/../../uboot/lib/libuboot.a
97CFLAGS+=	-I${.CURDIR}/../../uboot/lib
98CFLAGS+=	-I${.OBJDIR}/../../uboot/lib
99
100# where to get libstand from
101CFLAGS+=	-I${.CURDIR}/../../../../lib/libstand/
102
103DPADD=		${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBSTAND}
104LDADD=		${LIBFICL} ${LIBUBOOT} ${LIBFDT} -lstand
105
106vers.c:	${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version
107	sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT}
108
109loader.help: help.common help.uboot
110	cat ${.ALLSRC} | \
111	    awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET}
112
113.PATH: ${.CURDIR}/../../forth
114FILES=	loader.help
115
116.include <bsd.prog.mk>
117