xref: /freebsd/stand/uboot/Makefile (revision c57c26179033f64c2011a2d2a904ee3fa62e826a)
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
13BINDIR= 	/boot/uboot
14
15.include <bsd.init.mk>
16
17.include "${.CURDIR}/arch/${MACHINE_CPUARCH}/Makefile.inc"
18
19LOADER_UBLDR_BIN?=	yes
20.if ${LOADER_UBLDR_BIN} != "no"
21FILES+=		ubldr ubldr.bin
22.else
23PROG=		ubldr
24.endif
25
26NEWVERSWHAT=	"U-Boot loader" ${MACHINE_ARCH}
27INSTALLFLAGS=	-b
28WARNS?=		1
29
30.PATH:		${BOOTSRC}/common
31.PATH:		${.CURDIR}/arch/${MACHINE_CPUARCH}
32
33
34.if ${COMPILER_TYPE} == "gcc"
35CWARNFLAGS.self_reloc.c+=	-Wno-error=maybe-uninitialized
36.endif
37
38HELP_FILES=	${.CURDIR}/help.uboot ${BOOTSRC}/fdt/help.fdt
39HELP_FILENAME=	loader.help.uboot
40
41# Always add MI sources
42.include	"${BOOTSRC}/loader.mk"
43
44LDSCRIPT=	${.CURDIR}/arch/${MACHINE_CPUARCH}/${MACHINE_CPUARCH}.ldscript
45LDFLAGS=	-nostdlib -static -T ${LDSCRIPT}
46LDFLAGS+=	-Wl,-znotext
47
48SRCS+=		main.c vers.c
49SRCS+=		copy.c devicename.c elf_freebsd.c glue.c
50SRCS+=		net.c reboot.c time.c
51SRCS+=		uboot_console.c uboot_disk.c uboot_fdt.c uboot_module.c
52
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} ${LIBSAFDT} ${LIBSA}
82LDADD=		${LDR_INTERP} ${LIBSAFDT} ${LIBSA}
83
84.include <bsd.prog.mk>
85