xref: /freebsd/stand/uboot/Makefile (revision f374ba41f55c1a127303d92d830dd58eef2f5243)
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
39HELP_FILENAME=	loader.help.uboot
40
41# Always add MI sources
42.include	"${BOOTSRC}/loader.mk"
43
44LDSCRIPT=	${.CURDIR}/arch/${MACHINE_CPUARCH}/ldscript.${MACHINE_CPUARCH}
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 gfx_fb_stub.c
51SRCS+=		uboot_console.c uboot_disk.c uboot_fdt.c uboot_module.c
52
53CFLAGS.gfx_fb_stub.c += -I${SRCTOP}/contrib/pnglite -I${SRCTOP}/sys/teken
54CFLAGS.glue.c+=	-DHAVE_MEMCPY -I${SRCTOP}/sys/contrib/zlib
55
56CFLAGS+=	-I${BOOTSRC}/common
57CFLAGS+=	-I${.CURDIR}
58CFLAGS+=	-I${.OBJDIR}
59
60.if ${MACHINE_CPUARCH} == "arm"
61SRCS+=	metadata.c
62.endif
63
64.include "${BOOTSRC}/fdt.mk"
65
66# Pick up the bootstrap header for some interface items
67CFLAGS+=	-I${LDRSRC}
68
69# libfdt headers
70CFLAGS+=	-I${FDTSRC}
71
72.ifdef(BOOT_DISK_DEBUG)
73# Make the disk code more talkative
74CFLAGS+= -DDISK_DEBUG
75.endif
76
77.if ${LOADER_UBLDR_BIN} != "no"
78OBJS+=  ${SRCS:N*.h:R:S/$/.o/g}
79ubldr ubldr.bin ubldr.pie: ${OBJS}
80.endif
81
82DPADD=		${LDR_INTERP} ${LIBFDT} ${LIBSA}
83LDADD=		${LDR_INTERP} ${LIBFDT} ${LIBSA}
84
85.include <bsd.prog.mk>
86