summaryrefslogtreecommitdiffstats
path: root/stand/mips/uboot/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'stand/mips/uboot/Makefile')
-rw-r--r--stand/mips/uboot/Makefile57
1 files changed, 57 insertions, 0 deletions
diff --git a/stand/mips/uboot/Makefile b/stand/mips/uboot/Makefile
new file mode 100644
index 0000000..b941ba3
--- /dev/null
+++ b/stand/mips/uboot/Makefile
@@ -0,0 +1,57 @@
+# $FreeBSD$
+
+LOADER_CD9660_SUPPORT?= no
+LOADER_EXT2FS_SUPPORT?= no
+LOADER_MSDOS_SUPPORT?= yes
+LOADER_UFS_SUPPORT?= yes
+LOADER_NET_SUPPORT?= yes
+LOADER_NFS_SUPPORT?= yes
+LOADER_TFTP_SUPPORT?= no
+LOADER_GZIP_SUPPORT?= no
+LOADER_BZIP2_SUPPORT?= no
+
+.include <bsd.init.mk>
+
+FILES+= ubldr
+
+NEWVERSWHAT= "U-Boot loader" ${MACHINE_ARCH}
+INSTALLFLAGS= -b
+WARNS?= 1
+# Address at which ubldr will be loaded.
+# This varies for different boards and SOCs.
+UBLDR_LOADADDR?= 0xffffffff80800000
+
+# Architecture-specific loader code
+SRCS= start.S conf.c vers.c
+
+HELP_FILES+= help.uboot ${BOOTSRC}/fdt/help.fdt
+
+# Always add MI sources
+.include "${BOOTSRC}/loader.mk"
+
+CFLAGS+= -ffreestanding -msoft-float -g
+
+LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.${MACHINE_CPUARCH}
+
+.include "${BOOTSRC}/uboot.mk"
+
+DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA}
+LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA}
+
+OBJS+= ${SRCS:N*.h:R:S/$/.o/g}
+
+ldscript.abs:
+ echo "UBLDR_LOADADDR = ${UBLDR_LOADADDR};" >${.TARGET}
+
+ldscript.pie:
+ echo "UBLDR_LOADADDR = 0;" >${.TARGET}
+
+ubldr: ${OBJS} ldscript.abs ${.CURDIR}/ldscript.${MACHINE_CPUARCH} ${DPADD}
+ ${CC} ${CFLAGS} -T ldscript.abs ${LDFLAGS} \
+ -o ${.TARGET} ${OBJS} ${LDADD}
+ ${OBJCOPY} -S -O binary ubldr ubldr.bin
+
+CLEANFILES+= ldscript.abs ldscript.pie ubldr ubldr.pie ubldr.bin
+
+.include <bsd.stand.mk>
+.include <bsd.prog.mk>
OpenPOWER on IntegriCloud