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