]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/blob - sys/boot/arm/uboot/Makefile
Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.
[FreeBSD/stable/10.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 # clang doesn't understand %D as a specifier to printf
113 NO_WERROR.clang=
114
115 DPADD=          ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBSTAND}
116 LDADD=          ${LIBFICL} ${LIBUBOOT} ${LIBFDT} -lstand
117
118 vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version
119         sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT}
120
121 loader.help: help.common help.uboot ${.CURDIR}/../../fdt/help.fdt
122         cat ${.ALLSRC} | \
123             awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET}
124
125 ${PROG}: ldscript.generated ${.CURDIR}/ldscript.${MACHINE_CPUARCH}
126
127 ldscript.generated::
128         rm -f ldscript.generated.tmp
129         echo "UBLDR_LOADADDR = ${UBLDR_LOADADDR};" >ldscript.generated.tmp
130         if diff ldscript.generated ldscript.generated.tmp > /dev/null; then \
131                 true; \
132         else \
133                 rm -f ldscript.generated; \
134                 mv ldscript.generated.tmp ldscript.generated; \
135         fi
136
137 .if !defined(LOADER_ONLY)
138 .PATH: ${.CURDIR}/../../forth
139 FILES+= loader.help loader.4th support.4th loader.conf
140 FILES+= screen.4th frames.4th beastie.4th
141 FILES+= brand.4th check-password.4th color.4th delay.4th
142 FILES+= menu.4th menu-commands.4th menusets.4th shortcuts.4th version.4th
143 FILESDIR_loader.conf=   /boot/defaults
144
145 # Put sample loader.rc and menu.rc on disk but don't enable them
146 # by default.
147 FILES+= loader.rc
148 FILESNAME_loader.rc=    loader.rc.sample
149 FILES+= menu.rc
150 FILESNAME_menu.rc=      menu.rc.sample
151 .endif
152
153 .include <bsd.prog.mk>