3 LOADER_NET_SUPPORT?= yes
4 LOADER_MSDOS_SUPPORT?= yes
5 LOADER_UFS_SUPPORT?= yes
6 LOADER_CD9660_SUPPORT?= no
7 LOADER_EXT2FS_SUPPORT?= no
15 # architecture-specific loader code
27 .if ${MK_LOADER_ZFS} != "no"
29 CFLAGS+= -DEFI_ZFS_BOOT
33 .if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} > 40201
34 CWARNFLAGS.self_reloc.c+= -Wno-error=maybe-uninitialized
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
42 CWARNFLAGS.main.c+= -Wno-format
44 .PATH: ${.CURDIR}/arch/${MACHINE}
46 .PATH: ${BOOTSRC}/i386/libi386
47 .include "${.CURDIR}/arch/${MACHINE}/Makefile.inc"
50 CFLAGS+= -I${.CURDIR}/arch/${MACHINE}
51 CFLAGS+= -I${EFISRC}/include
52 CFLAGS+= -I${EFISRC}/include/${MACHINE}
53 CFLAGS+= -I${SYSDIR}/contrib/dev/acpica/include
54 CFLAGS+= -I${BOOTSRC}/i386/libi386
55 CFLAGS+= -DNO_PCI -DEFI
57 .if !defined(BOOT_HIDE_SERIAL_NUMBERS)
58 # Export serial numbers, UUID, and asset tag from loader.
59 CFLAGS+= -DSMBIOS_SERIAL_NUMBERS
60 .if defined(BOOT_LITTLE_ENDIAN_UUID)
61 # Use little-endian UUID format as defined in SMBIOS 2.6.
62 CFLAGS+= -DSMBIOS_LITTLE_ENDIAN_UUID
63 .elif defined(BOOT_NETWORK_ENDIAN_UUID)
64 # Use network-endian UUID format for backward compatibility.
65 CFLAGS+= -DSMBIOS_NETWORK_ENDIAN_UUID
69 .if defined(HAVE_FDT) && ${MK_FDT} != "no"
70 .include "${BOOTSRC}/fdt.mk"
71 LIBEFI_FDT= ${BOOTOBJ}/efi/fdt/libefi_fdt.a
74 # Include bcache code.
77 .if defined(EFI_STAGING_SIZE)
78 CFLAGS+= -DEFI_STAGING_SIZE=${EFI_STAGING_SIZE}
81 # Always add MI sources
82 .include "${BOOTSRC}/loader.mk"
85 FILESMODE_loader.efi= ${BINMODE}
87 LDSCRIPT= ${.CURDIR}/arch/${MACHINE}/ldscript.${MACHINE}
88 LDFLAGS+= -Wl,-T${LDSCRIPT},-Bsymbolic,-znotext -shared
90 CLEANFILES+= loader.efi
92 NEWVERSWHAT= "EFI loader" ${MACHINE}
94 .if ${MACHINE_CPUARCH} == "amd64"
95 EFI_TARGET= efi-app-x86_64
96 .elif ${MACHINE_CPUARCH} == "i386"
97 EFI_TARGET= efi-app-ia32
102 # Arbitrarily set the PE/COFF header timestamps to 1 Jan 2016 00:00:00
103 # for build reproducibility.
104 SOURCE_DATE_EPOCH?=1451606400
106 if ${NM} ${.ALLSRC} | grep ' U '; then \
107 echo "Undefined symbols in ${.ALLSRC}"; \
110 SOURCE_DATE_EPOCH=${SOURCE_DATE_EPOCH} \
111 ${OBJCOPY} -j .peheader -j .text -j .sdata -j .data \
112 -j .dynamic -j .dynsym -j .rel.dyn \
113 -j .rela.dyn -j .reloc -j .eh_frame -j set_Xcommand_set \
114 -j set_Xficl_compile_set \
115 --output-target=${EFI_TARGET} ${.ALLSRC} ${.TARGET}
117 LIBEFI= ${BOOTOBJ}/efi/libefi/libefi.a
119 DPADD= ${LDR_INTERP} ${LIBEFI} ${LIBFDT} ${LIBEFI_FDT} ${LIBSA} ${LDSCRIPT}
120 LDADD= ${LDR_INTERP} ${LIBEFI} ${LIBFDT} ${LIBEFI_FDT} ${LIBSA}
122 .include <bsd.prog.mk>