aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorHeinrich Schuchardt <xypron.glpk@gmx.de>2019-11-07 08:05:17 +0100
committerHeinrich Schuchardt <xypron.glpk@gmx.de>2019-11-12 23:13:54 +0100
commit3b4847cbee7cf5c2a6ea19c25003876d0cba4ced (patch)
tree9a3ce2aad6d03b5bb61018611e9d8314f70f036f /Makefile
parent7264e21fdead677687934eecda6ac98f37851acf (diff)
downloadu-boot-3b4847cbee7cf5c2a6ea19c25003876d0cba4ced.zip
u-boot-3b4847cbee7cf5c2a6ea19c25003876d0cba4ced.tar.gz
u-boot-3b4847cbee7cf5c2a6ea19c25003876d0cba4ced.tar.bz2
efi_loader: support building UEFI binaries on sandbox
On the sandbox the UEFI binaries must match the host architectures. Adjust the Makefiles. Provide the PE/COFF header and relocation files. Allow building helloworld.efi on the sandbox. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile19
1 files changed, 19 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index a9a78c3..c746de6 100644
--- a/Makefile
+++ b/Makefile
@@ -17,6 +17,25 @@ NAME =
# o Look for make include files relative to root of kernel src
MAKEFLAGS += -rR --include-dir=$(CURDIR)
+# Determine host architecture
+include include/host_arch.h
+MK_ARCH="${shell uname -m}"
+unexport HOST_ARCH
+ifeq ("x86_64", $(MK_ARCH))
+ export HOST_ARCH=$(HOST_ARCH_X86_64)
+else ifneq (,$(findstring $(MK_ARCH), "i386" "i486" "i586" "i686"))
+ export HOST_ARCH=$(HOST_ARCH_X86)
+else ifneq (,$(findstring $(MK_ARCH), "aarch64" "armv8l"))
+ export HOST_ARCH=$(HOST_ARCH_AARCH64)
+else ifeq ("armv7l", $(MK_ARCH))
+ export HOST_ARCH=$(HOST_ARCH_ARM)
+else ifeq ("riscv32", $(MK_ARCH))
+ export HOST_ARCH=$(HOST_ARCH_RISCV32)
+else ifeq ("riscv64", $(MK_ARCH))
+ export HOST_ARCH=$(HOST_ARCH_RISCV64)
+endif
+undefine MK_ARCH
+
# Avoid funny character set dependencies
unexport LC_ALL
LC_COLLATE=C