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