Makefile revision 329175
1# $FreeBSD: stable/11/stand/efi/libefi/Makefile 329175 2018-02-12 17:44:35Z kevans $
2
3.include <bsd.init.mk>
4
5.if ${MK_FORTH} != "no"
6.include	"${BOOTSRC}/ficl.mk"
7.endif
8
9LIB=	efi
10INTERNALLIB=
11WARNS?=	2
12
13SRCS=	delay.c devpath.c efi_console.c efichar.c efinet.c efipart.c env.c errno.c \
14	handles.c wchar.c libefi.c efi_driver_utils.c efizfs.c devicename.c
15
16.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386"
17SRCS+=	time.c
18.elif ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "arm"
19SRCS+=	time_event.c
20.endif
21
22# We implement a slightly non-standard %S in that it always takes a
23# CHAR16 that's common in UEFI-land instead of a wchar_t. This only
24# seems to matter on arm64 where wchar_t defaults to an int instead
25# of a short. There's no good cast to use here so just ignore the
26# warnings for now.
27CWARNFLAGS.efinet.c+=	-Wno-format
28CWARNFLAGS.efipart.c+=	-Wno-format
29CWARNFLAGS.env.c+=	-Wno-format
30
31.if ${MACHINE_CPUARCH} == "aarch64"
32CFLAGS+=	-mgeneral-regs-only
33.endif
34.if ${MACHINE_ARCH} == "amd64"
35CFLAGS+= -fPIC -mno-red-zone
36.endif
37CFLAGS+= -I${EFIINC}
38CFLAGS+= -I${EFIINCMD}
39.if ${MK_ZFS} != "no"
40CFLAGS+=	-I${ZFSSRC}
41CFLAGS+=	-DEFI_ZFS_BOOT
42.endif
43
44# Pick up the bootstrap header for some interface items
45CFLAGS+= -I${LDRSRC}
46
47# Handle FreeBSD specific %b and %D printf format specifiers
48CFLAGS+= ${FORMAT_EXTENSIONS}
49
50# Do not use TERM_EMU on arm and arm64 as it doesn't behave well with serial console
51.if ${MACHINE_CPUARCH} != "arm" && ${MACHINE_CPUARCH} != "aarch64"
52CFLAGS+= -DTERM_EMU
53.endif
54
55.include <bsd.lib.mk>
56