summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorArd Biesheuvel <ard.biesheuvel@linaro.org>2014-08-12 10:54:05 -0400
committerPeter Jones <pjones@redhat.com>2014-08-12 10:54:05 -0400
commitf7a182154e19e99e1eb88f5fe8111a37e68cda8e (patch)
treecba4892c17076ab68ad174d0bbabb612a09573f6 /lib
parent277127d1b34778076c07556b11c6cbf917bf6252 (diff)
downloadefi-boot-shim-f7a182154e19e99e1eb88f5fe8111a37e68cda8e.tar.gz
efi-boot-shim-f7a182154e19e99e1eb88f5fe8111a37e68cda8e.zip
Factor out x86-isms and add cross compile support
This patch cleans up and refactors the Makefiles to better allow new architectures to be added: - remove unused Makefile definitions - import Makefile definitions from top level rather than redefining - move x86 specific CFLAGS to inside ifeq() blocks - remove x86 inline asm - allow $(FORMAT) to be overridden: this is necessary as there exists no EFI or PE/COFF aware objcopy for ARM Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/Makefile14
1 files changed, 4 insertions, 10 deletions
diff --git a/lib/Makefile b/lib/Makefile
index a9c9cf66..ebd21a14 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -2,23 +2,17 @@ TARGET = lib.a
LIBFILES = simple_file.o guid.o console.o execute.o configtable.o shell.o variables.o security_policy.o
-ARCH = $(shell uname -m | sed s,i[3456789]86,ia32,)
-
-EFI_INCLUDE = /usr/include/efi
EFI_INCLUDES = -I$(EFI_INCLUDE) -I$(EFI_INCLUDE)/$(ARCH) -I$(EFI_INCLUDE)/protocol -I../include
-EFI_CRT_OBJS = $(EFI_PATH)/crt0-efi-$(ARCH).o
-EFI_LDS = $(EFI_PATH)/elf_$(ARCH)_efi.lds
-
CFLAGS = -ggdb -O0 -fno-stack-protector -fno-strict-aliasing -fpic \
- -fshort-wchar -Wall -mno-red-zone -DBUILD_EFI -fno-builtin \
- -Werror \
+ -fshort-wchar -Wall -DBUILD_EFI -fno-builtin -Werror \
$(EFI_INCLUDES)
+
ifeq ($(ARCH),x86_64)
- CFLAGS += -DEFI_FUNCTION_WRAPPER -DGNU_EFI_USE_MS_ABI
+ CFLAGS += -mno-red-zone -DEFI_FUNCTION_WRAPPER -DGNU_EFI_USE_MS_ABI
endif
ifeq ($(ARCH),ia32)
- CFLAGS += -m32
+ CFLAGS += -mno-red-zone -m32
endif
lib.a: $(LIBFILES)