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