xref: /freebsd/stand/efi/Makefile.inc (revision edbbf26e2650e02cd3925dd1deaacf9b8fb2e2a0)
1.include <src.opts.mk>
2
3# Options used when building app-specific efi components
4# See conf/kern.mk for the correct set of these
5CFLAGS+=	-Wformat
6LDFLAGS+=	-nostdlib
7
8.if ${MACHINE_CPUARCH} == "amd64"
9CFLAGS+=	-fshort-wchar
10CFLAGS+=	-mno-red-zone
11.endif
12
13.if ${MACHINE_CPUARCH} == "aarch64"
14CFLAGS+=	-fshort-wchar
15CFLAGS+=	-fPIC
16.endif
17
18.if ${MACHINE_CPUARCH} == "arm"
19CFLAGS+=	-fPIC
20.endif
21
22.if ${MACHINE_CPUARCH} == "amd64"
23.if ${DO32:U0} == 1
24EFI_TARGET=	efi-app-ia32
25.else
26EFI_TARGET=	efi-app-x86_64
27.endif
28.else
29EFI_TARGET=	binary
30.endif
31
32# GNU or ELF Tool Chain objcopy is usable for building EFI objects.
33# LLVM objcopy is not.  Use elfcopy if we've bootstrapped it (and thus
34# known to be available) or objcopy is LLVM's.
35.if ${MK_ELFTOOLCHAIN_BOOTSTRAP} != "no"
36EFI_OBJCOPY?=	elfcopy
37.else
38_v!=		${OBJCOPY} --version
39.if ${_v:Mllvm-objcopy*} == ""
40EFI_OBJCOPY?=	${OBJCOPY}
41.else
42EFI_OBJCOPY?=	elfcopy
43.endif
44.endif
45
46# Arbitrarily set the PE/COFF header timestamps to 1 Jan 2024 00:00:00
47# for build reproducibility.
48SOURCE_DATE_EPOCH?=1704067200
49
50.include "../Makefile.inc"
51