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