6 NEWVERSWHAT= "U-Boot loader" ${MACHINE_ARCH}
10 # Address at which ubldr will be loaded.
11 # This varies for different boards and SOCs.
12 UBLDR_LOADADDR?= 0x1000000
14 # Architecture-specific loader code
15 SRCS= start.S conf.c vers.c
17 .if !defined(LOADER_NO_DISK_SUPPORT)
18 LOADER_DISK_SUPPORT?= yes
20 LOADER_DISK_SUPPORT= no
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
28 LOADER_NANDFS_SUPPORT?= no
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
36 LOADER_FDT_SUPPORT= yes
38 LOADER_FDT_SUPPORT= no
41 .if ${LOADER_DISK_SUPPORT} == "yes"
42 CFLAGS+= -DLOADER_DISK_SUPPORT
44 .if ${LOADER_UFS_SUPPORT} == "yes"
45 CFLAGS+= -DLOADER_UFS_SUPPORT
47 .if ${LOADER_CD9660_SUPPORT} == "yes"
48 CFLAGS+= -DLOADER_CD9660_SUPPORT
50 .if ${LOADER_EXT2FS_SUPPORT} == "yes"
51 CFLAGS+= -DLOADER_EXT2FS_SUPPORT
53 .if ${LOADER_NANDFS_SUPPORT} == "yes"
54 CFLAGS+= -DLOADER_NANDFS_SUPPORT
56 .if ${LOADER_GZIP_SUPPORT} == "yes"
57 CFLAGS+= -DLOADER_GZIP_SUPPORT
59 .if ${LOADER_BZIP2_SUPPORT} == "yes"
60 CFLAGS+= -DLOADER_BZIP2_SUPPORT
62 .if ${LOADER_NET_SUPPORT} == "yes"
63 CFLAGS+= -DLOADER_NET_SUPPORT
65 .if ${LOADER_NFS_SUPPORT} == "yes"
66 CFLAGS+= -DLOADER_NFS_SUPPORT
68 .if ${LOADER_TFTP_SUPPORT} == "yes"
69 CFLAGS+= -DLOADER_TFTP_SUPPORT
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
78 .if !defined(NO_FORTH)
81 CFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../../ficl -I${.CURDIR}/../../ficl/arm
82 LIBFICL= ${.OBJDIR}/../../ficl/libficl.a
85 # Always add MI sources
86 .PATH: ${.CURDIR}/../../common
87 .include "${.CURDIR}/../../common/Makefile.inc"
88 CFLAGS+= -I${.CURDIR}/../../common
91 CLEANFILES+= vers.c loader.help
93 CFLAGS+= -ffreestanding
95 LDFLAGS= -nostdlib -static
96 LDFLAGS+= -T ldscript.generated
97 LDFLAGS+= -T ${.CURDIR}/ldscript.${MACHINE_CPUARCH}
99 # Pull in common loader code
100 .PATH: ${.CURDIR}/../../uboot/common
101 .include "${.CURDIR}/../../uboot/common/Makefile.inc"
102 CFLAGS+= -I${.CURDIR}/../../uboot/common
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
109 # where to get libstand from
110 CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/
112 # clang doesn't understand %D as a specifier to printf
115 DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBSTAND}
116 LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} -lstand
118 vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version
119 sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT}
121 loader.help: help.common help.uboot ${.CURDIR}/../../fdt/help.fdt
123 awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET}
125 ${PROG}: ldscript.generated ${.CURDIR}/ldscript.${MACHINE_CPUARCH}
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 \
133 rm -f ldscript.generated; \
134 mv ldscript.generated.tmp ldscript.generated; \
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
145 # Put sample loader.rc and menu.rc on disk but don't enable them
148 FILESNAME_loader.rc= loader.rc.sample
150 FILESNAME_menu.rc= menu.rc.sample
153 .include <bsd.prog.mk>