2008-10-14 10:11:14 +00:00
|
|
|
# $FreeBSD$
|
|
|
|
|
2017-11-08 14:44:45 +00:00
|
|
|
LOADER_UFS_SUPPORT?= yes
|
|
|
|
LOADER_CD9660_SUPPORT?= no
|
|
|
|
LOADER_MSDOS_SUPPORT?= no
|
|
|
|
LOADER_EXT2FS_SUPPORT?= no
|
|
|
|
LOADER_NET_SUPPORT?= yes
|
|
|
|
LOADER_NFS_SUPPORT?= yes
|
|
|
|
LOADER_TFTP_SUPPORT?= no
|
|
|
|
LOADER_GZIP_SUPPORT?= no
|
|
|
|
LOADER_BZIP2_SUPPORT?= no
|
|
|
|
|
2017-10-25 15:27:53 +00:00
|
|
|
.include <bsd.init.mk>
|
2010-06-13 12:46:32 +00:00
|
|
|
|
2017-11-10 23:54:58 +00:00
|
|
|
FILES+= ubldr ubldr.bin
|
2015-05-10 19:14:28 +00:00
|
|
|
|
2008-10-14 10:11:14 +00:00
|
|
|
NEWVERSWHAT= "U-Boot loader" ${MACHINE_ARCH}
|
|
|
|
INSTALLFLAGS= -b
|
|
|
|
WARNS?= 1
|
2012-05-27 16:27:04 +00:00
|
|
|
# Address at which ubldr will be loaded.
|
|
|
|
# This varies for different boards and SOCs.
|
|
|
|
UBLDR_LOADADDR?= 0x1000000
|
2008-10-14 10:11:14 +00:00
|
|
|
|
|
|
|
# Architecture-specific loader code
|
2015-05-10 19:14:28 +00:00
|
|
|
SRCS= start.S conf.c self_reloc.c vers.c
|
2008-10-14 10:11:14 +00:00
|
|
|
|
2017-03-28 23:56:02 +00:00
|
|
|
.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} > 40201
|
|
|
|
CWARNFLAGS.self_reloc.c+= -Wno-error=maybe-uninitialized
|
|
|
|
.endif
|
|
|
|
|
2017-12-18 04:51:34 +00:00
|
|
|
HELP_FILES= ${.CURDIR}/help.uboot ${BOOTSRC}/fdt/help.fdt
|
2017-11-10 23:54:58 +00:00
|
|
|
|
2008-10-14 10:11:14 +00:00
|
|
|
# Always add MI sources
|
2017-10-25 15:27:53 +00:00
|
|
|
.include "${BOOTSRC}/loader.mk"
|
2008-10-14 10:11:14 +00:00
|
|
|
|
2015-05-10 19:14:28 +00:00
|
|
|
LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.${MACHINE_CPUARCH}
|
2017-07-01 18:48:15 +00:00
|
|
|
LDFLAGS+= -Wl,-znotext
|
2008-10-14 10:11:14 +00:00
|
|
|
|
|
|
|
# Pull in common loader code
|
2017-10-25 15:27:53 +00:00
|
|
|
.include "${BOOTSRC}/uboot.mk"
|
2008-10-14 10:11:14 +00:00
|
|
|
|
2016-12-15 17:36:54 +00:00
|
|
|
CFLAGS+= -fPIC
|
|
|
|
|
2017-10-09 22:12:46 +00:00
|
|
|
DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA}
|
|
|
|
LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA}
|
2008-10-14 10:11:14 +00:00
|
|
|
|
2015-05-10 19:14:28 +00:00
|
|
|
OBJS+= ${SRCS:N*.h:R:S/$/.o/g}
|
|
|
|
|
|
|
|
ldscript.abs:
|
|
|
|
echo "UBLDR_LOADADDR = ${UBLDR_LOADADDR};" >${.TARGET}
|
|
|
|
|
|
|
|
ldscript.pie:
|
|
|
|
echo "UBLDR_LOADADDR = 0;" >${.TARGET}
|
|
|
|
|
2015-05-16 21:08:33 +00:00
|
|
|
ubldr: ${OBJS} ldscript.abs ${.CURDIR}/ldscript.${MACHINE_CPUARCH} ${DPADD}
|
2015-05-10 19:14:28 +00:00
|
|
|
${CC} ${CFLAGS} -T ldscript.abs ${LDFLAGS} \
|
|
|
|
-o ${.TARGET} ${OBJS} ${LDADD}
|
|
|
|
|
2015-05-16 21:08:33 +00:00
|
|
|
ubldr.pie: ${OBJS} ldscript.pie ${.CURDIR}/ldscript.${MACHINE_CPUARCH} ${DPADD}
|
2015-05-10 19:14:28 +00:00
|
|
|
${CC} ${CFLAGS} -T ldscript.pie ${LDFLAGS} -pie -Wl,-Bsymbolic \
|
|
|
|
-o ${.TARGET} ${OBJS} ${LDADD}
|
|
|
|
|
|
|
|
ubldr.bin: ubldr.pie
|
|
|
|
${OBJCOPY} -S -O binary ubldr.pie ${.TARGET}
|
|
|
|
|
|
|
|
CLEANFILES+= ldscript.abs ldscript.pie ubldr ubldr.pie ubldr.bin
|
2012-05-27 16:27:04 +00:00
|
|
|
|
2008-10-14 10:11:14 +00:00
|
|
|
.include <bsd.prog.mk>
|