summaryrefslogtreecommitdiff
path: root/src/grp-boot
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2016-06-06 23:19:35 -0400
committerLuke Shumaker <lukeshu@sbcglobal.net>2016-06-06 23:19:35 -0400
commit30d9c5d71881b362e9808711b986964553494480 (patch)
treecd620dd23d3a8cddafaa9253618131bde7701f2f /src/grp-boot
parentf76d1e7b4baac2b43b97a2dca3ac5820d1fa30e1 (diff)
parent404c0969471ab1031e177cff27a5c152fde66bc2 (diff)
Merge branch 'lukeshu/postmove' into lukeshu/master
# Conflicts: # src/libsystemd/libsystemd-internal/Makefile
Diffstat (limited to 'src/grp-boot')
-rw-r--r--src/grp-boot/systemd-boot/Makefile61
1 files changed, 61 insertions, 0 deletions
diff --git a/src/grp-boot/systemd-boot/Makefile b/src/grp-boot/systemd-boot/Makefile
index 182a272054..afa32f02fd 100644
--- a/src/grp-boot/systemd-boot/Makefile
+++ b/src/grp-boot/systemd-boot/Makefile
@@ -23,6 +23,67 @@
include $(dir $(lastword $(MAKEFILE_LIST)))/../../config.mk
include $(topsrcdir)/build-aux/Makefile.head.mk
+ifneq ($(HAVE_GNUEFI),)
+efi_cppflags = \
+ $(EFI_CPPFLAGS) \
+ -I$(top_builddir) -include config.h \
+ -I$(EFI_INC_DIR)/efi \
+ -I$(EFI_INC_DIR)/efi/$(EFI_ARCH) \
+ -DEFI_MACHINE_TYPE_NAME=\"$(EFI_MACHINE_TYPE_NAME)\"
+
+efi_cflags = \
+ $(EFI_CFLAGS) \
+ -Wall \
+ -Wextra \
+ -std=gnu90 \
+ -nostdinc \
+ -ggdb -O0 \
+ -fpic \
+ -fshort-wchar \
+ -nostdinc \
+ -ffreestanding \
+ -fno-strict-aliasing \
+ -fno-stack-protector \
+ -Wsign-compare \
+ -Wno-missing-field-initializers
+
+ifneq ($(ARCH_X86_64),)
+efi_cflags += \
+ -mno-red-zone \
+ -mno-sse \
+ -mno-mmx \
+ -DEFI_FUNCTION_WRAPPER \
+ -DGNU_EFI_USE_MS_ABI
+endif
+
+ifneq ($(ARCH_IA32),)
+efi_cflags += \
+ -mno-sse \
+ -mno-mmx
+endif
+
+efi_ldflags = \
+ $(EFI_LDFLAGS) \
+ -T $(EFI_LDS_DIR)/elf_$(EFI_ARCH)_efi.lds \
+ -shared \
+ -Bsymbolic \
+ -nostdlib \
+ -znocombreloc \
+ -L $(EFI_LIB_DIR) \
+ $(EFI_LDS_DIR)/crt0-efi-$(EFI_ARCH).o
+
+# Aarch64 and ARM32 don't have an EFI capable objcopy. Use 'binary' instead,
+# and add required symbols manually.
+ifneq ($(ARCH_AARCH64),)
+efi_ldflags += --defsym=EFI_SUBSYSTEM=0xa
+EFI_FORMAT = -O binary
+else
+EFI_FORMAT = --target=efi-app-$(EFI_ARCH)
+endif
+endif
+endif
+
+# ------------------------------------------------------------------------------
systemd_boot_headers = \
src/boot/efi/util.h \
src/boot/efi/console.h \