xref: /freebsd/stand/uboot/Makefile (revision 994297b01b98816bea1abf45ae4bac1bc69ee7a0)
1# $FreeBSD$
2
3LOADER_UFS_SUPPORT?=	yes
4LOADER_CD9660_SUPPORT?=	no
5LOADER_MSDOS_SUPPORT?=	no
6LOADER_EXT2FS_SUPPORT?=	no
7LOADER_NET_SUPPORT?=	yes
8LOADER_NFS_SUPPORT?=	yes
9LOADER_TFTP_SUPPORT?=	no
10LOADER_GZIP_SUPPORT?=	no
11LOADER_BZIP2_SUPPORT?=	no
12LOADER_DISK_SUPPORT?=	yes
13
14.include <bsd.init.mk>
15
16.include "${.CURDIR}/arch/${MACHINE_CPUARCH}/Makefile.inc"
17
18LOADER_UBLDR_BIN?=	yes
19.if ${LOADER_UBLDR_BIN} != "no"
20FILES+=		ubldr ubldr.bin
21.else
22PROG=		ubldr
23.endif
24
25NEWVERSWHAT=	"U-Boot loader" ${MACHINE_ARCH}
26BINDIR= 	/boot/uboot
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
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
65CFLAGS+=	-fPIC
66
67# Pick up the bootstrap header for some interface items
68CFLAGS+=	-I${LDRSRC}
69
70# libfdt headers
71CFLAGS+=	-I${FDTSRC}
72
73.ifdef(BOOT_DISK_DEBUG)
74# Make the disk code more talkative
75CFLAGS+= -DDISK_DEBUG
76.endif
77
78.if ${LOADER_UBLDR_BIN} != "no"
79OBJS+=  ${SRCS:N*.h:R:S/$/.o/g}
80ubldr ubldr.bin ubldr.pie: ${OBJS}
81.endif
82
83DPADD=		${LDR_INTERP} ${LIBFDT} ${LIBSA}
84LDADD=		${LDR_INTERP} ${LIBFDT} ${LIBSA}
85
86.include <bsd.prog.mk>
87