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