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