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