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