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