From 9e74797f30ffa3e29d54438933f74ad53ad37f99 Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Tue, 27 Feb 2018 17:35:29 +0000 Subject: [PATCH] Move EFI up to common makefile. There's no need for all these .if's based on architecture. Sponsored by: Netflix --- share/mk/src.opts.mk | 4 +++- stand/Makefile | 4 ++++ stand/Makefile.amd64 | 1 - stand/Makefile.arm | 2 +- stand/Makefile.arm64 | 2 -- stand/Makefile.i386 | 2 -- stand/efi/Makefile | 6 ------ 7 files changed, 8 insertions(+), 13 deletions(-) diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk index e4f558525ddb..5763def7429d 100644 --- a/share/mk/src.opts.mk +++ b/share/mk/src.opts.mk @@ -125,6 +125,7 @@ __DEFAULT_YES_OPTIONS = \ LPR \ LS_COLORS \ LZMA_SUPPORT \ + LOADER_EFI \ LOADER_GELI \ MAIL \ MAILWRAPPER \ @@ -285,8 +286,9 @@ BROKEN_OPTIONS+=LIBSOFT .if ${__T:Mmips*} BROKEN_OPTIONS+=SSP .endif +# EFI doesn't exist on mips, powerpc, sparc or riscv. .if ${__T:Mmips*} || ${__T:Mpowerpc*} || ${__T:Msparc64} || ${__T:Mriscv*} -BROKEN_OPTIONS+=EFI +BROKEN_OPTIONS+=EFI LOADER_EFI .endif .if ${__T:Mmips64*} # profiling won't work on MIPS64 because there is only assembly for o32 diff --git a/stand/Makefile b/stand/Makefile index 242eb4c5297b..a22d771acb68 100644 --- a/stand/Makefile +++ b/stand/Makefile @@ -18,6 +18,10 @@ SUBDIR+= man .include +.if ${MK_EFI} != "no" && ${MK_LOADER_EFI} != "no" +SUBDIR+= efi +.endif + .if exists(${.CURDIR}/${MACHINE}/.) SUBDIR+= ${MACHINE} .endif diff --git a/stand/Makefile.amd64 b/stand/Makefile.amd64 index 2b742143fb33..3ae816158168 100644 --- a/stand/Makefile.amd64 +++ b/stand/Makefile.amd64 @@ -11,7 +11,6 @@ SUBDIR+= ficl32 SUBDIR+= liblua32 .endif -SUBDIR+= efi SUBDIR+= userboot .if ${MK_LOADER_GELI} == "yes" diff --git a/stand/Makefile.arm b/stand/Makefile.arm index 387b77bd344d..afd3319e48a1 100644 --- a/stand/Makefile.arm +++ b/stand/Makefile.arm @@ -7,4 +7,4 @@ SUBDIR+= fdt SUBDIR+= zfs .endif -SUBDIR+= efi uboot +SUBDIR+= uboot diff --git a/stand/Makefile.arm64 b/stand/Makefile.arm64 index bf0fd3988c15..e3bf756bd745 100644 --- a/stand/Makefile.arm64 +++ b/stand/Makefile.arm64 @@ -6,5 +6,3 @@ SUBDIR+= fdt .if ${MK_ZFS} != "no" SUBDIR+= zfs .endif - -SUBDIR+= efi diff --git a/stand/Makefile.i386 b/stand/Makefile.i386 index 966497496fd4..1936f593da3f 100644 --- a/stand/Makefile.i386 +++ b/stand/Makefile.i386 @@ -6,5 +6,3 @@ SUBDIR+= geli .if ${MK_ZFS} != "no" SUBDIR+= zfs .endif - -SUBDIR+= efi diff --git a/stand/efi/Makefile b/stand/efi/Makefile index ee1abfd583a4..bf37fccff666 100644 --- a/stand/efi/Makefile +++ b/stand/efi/Makefile @@ -8,17 +8,11 @@ NO_OBJ=t # than 4.5 supports it. .if ${COMPILER_TYPE} != "gcc" || ${COMPILER_VERSION} >= 40500 -.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "arm" .if ${MK_FDT} != "no" SUBDIR+= fdt .endif -.endif -.if ${MACHINE_CPUARCH} == "aarch64" || \ - ${MACHINE_CPUARCH} == "amd64" || \ - ${MACHINE_CPUARCH} == "arm" SUBDIR+= libefi loader boot1 -.endif .endif # ${COMPILER_TYPE} != "gcc" || ${COMPILER_VERSION} >= 40500