]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - sys/boot/arm/uboot/Makefile
Merge OpenBSM 1.2-alpha2 from vendor branch to FreeBSD 10-CURRENT; the
[FreeBSD/FreeBSD.git] / sys / boot / arm / uboot / Makefile
1 # $FreeBSD$
2
3 .include <bsd.own.mk>
4
5 PROG=           ubldr
6 NEWVERSWHAT=    "U-Boot loader" ${MACHINE_ARCH}
7 BINDIR?=        /boot
8 INSTALLFLAGS=   -b
9 WARNS?=         1
10 # Address at which ubldr will be loaded.
11 # This varies for different boards and SOCs.
12 UBLDR_LOADADDR?=        0x1000000
13
14 # Architecture-specific loader code
15 SRCS=           start.S conf.c vers.c
16
17 .if !defined(LOADER_NO_DISK_SUPPORT)
18 LOADER_DISK_SUPPORT?=   yes
19 .else
20 LOADER_DISK_SUPPORT=    no
21 .endif
22 LOADER_UFS_SUPPORT?=    yes
23 LOADER_CD9660_SUPPORT?= no
24 LOADER_EXT2FS_SUPPORT?= no
25 .if ${MK_NAND} != "no"
26 LOADER_NANDFS_SUPPORT?= yes
27 .else
28 LOADER_NANDFS_SUPPORT?= no
29 .endif
30 LOADER_NET_SUPPORT?=    yes
31 LOADER_NFS_SUPPORT?=    yes
32 LOADER_TFTP_SUPPORT?=   no
33 LOADER_GZIP_SUPPORT?=   no
34 LOADER_BZIP2_SUPPORT?=  no
35 .if ${MK_FDT} != "no"
36 LOADER_FDT_SUPPORT=     yes
37 .else
38 LOADER_FDT_SUPPORT=     no
39 .endif
40
41 .if ${LOADER_DISK_SUPPORT} == "yes"
42 CFLAGS+=        -DLOADER_DISK_SUPPORT
43 .endif
44 .if ${LOADER_UFS_SUPPORT} == "yes"
45 CFLAGS+=        -DLOADER_UFS_SUPPORT
46 .endif
47 .if ${LOADER_CD9660_SUPPORT} == "yes"
48 CFLAGS+=        -DLOADER_CD9660_SUPPORT
49 .endif
50 .if ${LOADER_EXT2FS_SUPPORT} == "yes"
51 CFLAGS+=        -DLOADER_EXT2FS_SUPPORT
52 .endif
53 .if ${LOADER_NANDFS_SUPPORT} == "yes"
54 CFLAGS+=        -DLOADER_NANDFS_SUPPORT
55 .endif
56 .if ${LOADER_GZIP_SUPPORT} == "yes"
57 CFLAGS+=        -DLOADER_GZIP_SUPPORT
58 .endif
59 .if ${LOADER_BZIP2_SUPPORT} == "yes"
60 CFLAGS+=        -DLOADER_BZIP2_SUPPORT
61 .endif
62 .if ${LOADER_NET_SUPPORT} == "yes"
63 CFLAGS+=        -DLOADER_NET_SUPPORT
64 .endif
65 .if ${LOADER_NFS_SUPPORT} == "yes"
66 CFLAGS+=        -DLOADER_NFS_SUPPORT
67 .endif
68 .if ${LOADER_TFTP_SUPPORT} == "yes"
69 CFLAGS+=        -DLOADER_TFTP_SUPPORT
70 .endif
71 .if ${LOADER_FDT_SUPPORT} == "yes"
72 CFLAGS+=        -I${.CURDIR}/../../fdt
73 CFLAGS+=        -I${.OBJDIR}/../../fdt
74 CFLAGS+=        -DLOADER_FDT_SUPPORT
75 LIBFDT=         ${.OBJDIR}/../../fdt/libfdt.a
76 .endif
77
78 .if !defined(NO_FORTH)
79 # Enable BootForth
80 BOOT_FORTH=     yes
81 CFLAGS+=        -DBOOT_FORTH -I${.CURDIR}/../../ficl -I${.CURDIR}/../../ficl/arm
82 LIBFICL=        ${.OBJDIR}/../../ficl/libficl.a
83 .endif
84
85 # Always add MI sources
86 .PATH:          ${.CURDIR}/../../common
87 .include        "${.CURDIR}/../../common/Makefile.inc"
88 CFLAGS+=        -I${.CURDIR}/../../common
89 CFLAGS+=        -I.
90
91 CLEANFILES+=    vers.c loader.help
92
93 CFLAGS+=        -ffreestanding
94
95 LDFLAGS=        -nostdlib -static
96 LDFLAGS+=       -T ldscript.generated
97 LDFLAGS+=       -T ${.CURDIR}/ldscript.${MACHINE_CPUARCH}
98
99 # Pull in common loader code
100 .PATH:          ${.CURDIR}/../../uboot/common
101 .include        "${.CURDIR}/../../uboot/common/Makefile.inc"
102 CFLAGS+=        -I${.CURDIR}/../../uboot/common
103
104 # U-Boot standalone support library
105 LIBUBOOT=       ${.OBJDIR}/../../uboot/lib/libuboot.a
106 CFLAGS+=        -I${.CURDIR}/../../uboot/lib
107 CFLAGS+=        -I${.OBJDIR}/../../uboot/lib
108
109 # where to get libstand from
110 CFLAGS+=        -I${.CURDIR}/../../../../lib/libstand/
111
112 DPADD=          ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBSTAND}
113 LDADD=          ${LIBFICL} ${LIBUBOOT} ${LIBFDT} -lstand
114
115 vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version
116         sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT}
117
118 loader.help: help.common help.uboot
119         cat ${.ALLSRC} | \
120             awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET}
121
122 ${PROG}: ldscript.generated ${.CURDIR}/ldscript.${MACHINE_CPUARCH}
123
124 ldscript.generated::
125         rm -f ldscript.generated.tmp
126         echo "UBLDR_LOADADDR = ${UBLDR_LOADADDR};" >ldscript.generated.tmp
127         if diff ldscript.generated ldscript.generated.tmp > /dev/null; then \
128                 true; \
129         else \
130                 rm -f ldscript.generated; \
131                 mv ldscript.generated.tmp ldscript.generated; \
132         fi
133
134 .PATH: ${.CURDIR}/../../forth
135 FILES=  loader.help
136
137 .include <bsd.prog.mk>