freebsd-nq/stand/uboot/Makefile
Warner Losh 9dc70af83e stand/uboot: reorg
Build uboot ubldr and friends like we build efi binaries
o move everything to be under stand/uboot
o md code goes in arch/$ARCH
o move everything over from the library
  - Had to rename console.c, disk.c and module.c due to conflicts
o update version to 1.5 to reflect the new way of building

This results in a more consistent build system and should represent no
functional change, apart from powerpc version getting new help
file. Also, moved to exlcuding uboot on powerpc64le by using
BROKEN_OPTION instead of the incidental exclusion we had before due to
Makefile reorgs.

Sponsored by:		Netflix
Feedback by:		stevek, jrtc27
Differential Revision:	https://reviews.freebsd.org/D33362
2021-12-14 21:09:53 -07:00

82 lines
1.7 KiB
Makefile

# $FreeBSD$
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
LOADER_DISK_SUPPORT?= yes
.include <bsd.init.mk>
.include "${.CURDIR}/arch/${MACHINE_CPUARCH}/Makefile.inc"
.if ${MK_PIE} == "yes"
FILES+= ubldr ubldr.bin
OBJS+= ${SRCS:N*.h:R:S/$/.o/g}
.else
PROG= ubldr
.endif
NEWVERSWHAT= "U-Boot loader" ${MACHINE_ARCH}
BINDIR= /boot/uboot
INSTALLFLAGS= -b
WARNS?= 1
.PATH: ${BOOTSRC}/common
.PATH: ${.CURDIR}/arch/${MACHINE_CPUARCH}
.if ${COMPILER_TYPE} == "gcc"
CWARNFLAGS.self_reloc.c+= -Wno-error=maybe-uninitialized
.endif
HELP_FILES= ${.CURDIR}/help.uboot ${BOOTSRC}/fdt/help.fdt
# Always add MI sources
.include "${BOOTSRC}/loader.mk"
LDSCRIPT= ${.CURDIR}/arch/${MACHINE_CPUARCH}/ldscript.${MACHINE_CPUARCH}
LDFLAGS= -nostdlib -static -T ${LDSCRIPT}
LDFLAGS+= -Wl,-znotext
SRCS+= main.c vers.c
SRCS+= copy.c devicename.c elf_freebsd.c glue.c
SRCS+= net.c reboot.c time.c gfx_fb_stub.c
SRCS+= uboot_console.c uboot_disk.c uboot_fdt.c uboot_module.c
CFLAGS.gfx_fb_stub.c += -I${SRCTOP}/contrib/pnglite -I${SRCTOP}/sys/teken
CFLAGS.glue.c+= -DHAVE_MEMCPY -I${SRCTOP}/sys/contrib/zlib
CFLAGS+= -I${BOOTSRC}/common
CFLAGS+= -I${.CURDIR}
CFLAGS+= -I${.OBJDIR}
.if ${MACHINE_CPUARCH} == "arm"
SRCS+= metadata.c
.endif
.include "${BOOTSRC}/fdt.mk"
CFLAGS+= -fPIC
# Pick up the bootstrap header for some interface items
CFLAGS+= -I${LDRSRC}
# libfdt headers
CFLAGS+= -I${FDTSRC}
.ifdef(BOOT_DISK_DEBUG)
# Make the disk code more talkative
CFLAGS+= -DDISK_DEBUG
.endif
DPADD= ${LDR_INTERP} ${LIBFDT} ${LIBSA}
LDADD= ${LDR_INTERP} ${LIBFDT} ${LIBSA}
.include <bsd.prog.mk>