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