xref: /freebsd/stand/uboot/Makefile (revision 22cf89c938886d14f5796fc49f9f020c23ea8eaf)
1
2LOADER_UFS_SUPPORT?=	yes
3LOADER_CD9660_SUPPORT?=	no
4LOADER_MSDOS_SUPPORT?=	no
5LOADER_EXT2FS_SUPPORT?=	no
6LOADER_NET_SUPPORT?=	yes
7LOADER_NFS_SUPPORT?=	yes
8LOADER_TFTP_SUPPORT?=	no
9LOADER_GZIP_SUPPORT?=	no
10LOADER_BZIP2_SUPPORT?=	no
11LOADER_DISK_SUPPORT?=	yes
12
13.include <bsd.init.mk>
14
15.include "${.CURDIR}/arch/${MACHINE_CPUARCH}/Makefile.inc"
16
17LOADER_UBLDR_BIN?=	yes
18.if ${LOADER_UBLDR_BIN} != "no"
19FILES+=		ubldr ubldr.bin
20.else
21PROG=		ubldr
22.endif
23
24NEWVERSWHAT=	"U-Boot loader" ${MACHINE_ARCH}
25BINDIR= 	/boot/uboot
26INSTALLFLAGS=	-b
27WARNS?=		1
28
29.PATH:		${BOOTSRC}/common
30.PATH:		${.CURDIR}/arch/${MACHINE_CPUARCH}
31
32
33.if ${COMPILER_TYPE} == "gcc"
34CWARNFLAGS.self_reloc.c+=	-Wno-error=maybe-uninitialized
35.endif
36
37HELP_FILES=	${.CURDIR}/help.uboot ${BOOTSRC}/fdt/help.fdt
38HELP_FILENAME=	loader.help.uboot
39
40# Always add MI sources
41.include	"${BOOTSRC}/loader.mk"
42
43LDSCRIPT=	${.CURDIR}/arch/${MACHINE_CPUARCH}/ldscript.${MACHINE_CPUARCH}
44LDFLAGS=	-nostdlib -static -T ${LDSCRIPT}
45LDFLAGS+=	-Wl,-znotext
46
47SRCS+=		main.c vers.c
48SRCS+=		copy.c devicename.c elf_freebsd.c glue.c
49SRCS+=		net.c reboot.c time.c gfx_fb_stub.c
50SRCS+=		uboot_console.c uboot_disk.c uboot_fdt.c uboot_module.c
51
52CFLAGS.gfx_fb_stub.c += -I${SRCTOP}/contrib/pnglite -I${SRCTOP}/sys/teken
53CFLAGS.glue.c+=	-DHAVE_MEMCPY -I${SRCTOP}/sys/contrib/zlib
54
55CFLAGS+=	-I${BOOTSRC}/common
56CFLAGS+=	-I${.CURDIR}
57CFLAGS+=	-I${.OBJDIR}
58
59.if ${MACHINE_CPUARCH} == "arm"
60SRCS+=	metadata.c
61.endif
62
63.include "${BOOTSRC}/fdt.mk"
64
65# Pick up the bootstrap header for some interface items
66CFLAGS+=	-I${LDRSRC}
67
68# libfdt headers
69CFLAGS+=	-I${FDTSRC}
70
71.ifdef(BOOT_DISK_DEBUG)
72# Make the disk code more talkative
73CFLAGS+= -DDISK_DEBUG
74.endif
75
76.if ${LOADER_UBLDR_BIN} != "no"
77OBJS+=  ${SRCS:N*.h:R:S/$/.o/g}
78ubldr ubldr.bin ubldr.pie: ${OBJS}
79.endif
80
81DPADD=		${LDR_INTERP} ${LIBFDT} ${LIBSA}
82LDADD=		${LDR_INTERP} ${LIBFDT} ${LIBSA}
83
84.include <bsd.prog.mk>
85