summaryrefslogtreecommitdiff
path: root/efi/Makefile
diff options
context:
space:
mode:
authorMatt Fleming <matt.fleming@intel.com>2011-12-02 18:02:09 +0000
committerMatt Fleming <matt.fleming@intel.com>2011-12-16 16:31:19 +0000
commitd1195567fe9e6b580b04c73d78bb923383ac2dc9 (patch)
tree5681a2f6d895cc280999c491f46777192d713bfb /efi/Makefile
parent04303c2561333b937c30e37732cefe1df0abb280 (diff)
downloadsyslinux-d1195567fe9e6b580b04c73d78bb923383ac2dc9.tar.gz
efi: Add UEFI firmware backend
This commit adds 32-bit support for a Unified Extensible Firmware Interface backend. We use a wrapper program to create an EFI exe with only the minimum number of sections becaues the EFI loader doesn't like certain section sections, such as .gnu.hash, which we require for resolving symbols when ELF modules are loaded. We're currently including a lot more symbols than are necessary in efi/main.c so that the code compiles. Some of them are BIOS specific but I haven't got around to fixing up the core to not reference them directly yet. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Diffstat (limited to 'efi/Makefile')
-rw-r--r--efi/Makefile66
1 files changed, 66 insertions, 0 deletions
diff --git a/efi/Makefile b/efi/Makefile
new file mode 100644
index 00000000..294d8556
--- /dev/null
+++ b/efi/Makefile
@@ -0,0 +1,66 @@
+## -----------------------------------------------------------------------
+##
+## Copyright 2011 Intel Corporation; author: Matt Fleming
+##
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation, Inc., 53 Temple Place Ste 330,
+## Boston MA 02111-1307, USA; either version 2 of the License, or
+## (at your option) any later version; incorporated herein by reference.
+##
+## -----------------------------------------------------------------------
+
+topdir = ..
+MAKEDIR = $(topdir)/mk
+include $(MAKEDIR)/lib.mk
+include $(MAKEDIR)/efi.mk
+
+CORE_CSRC := $(wildcard $(core)/*.c $(core)/*/*.c $(core)/*/*/*.c)
+CORE_COBJ := $(patsubst %.c,%.o,$(CORE_CSRC))
+
+# Don't include console objects
+CORE_OBJS = $(filter-out $(core)/hello.o $(core)/rawcon.o \
+ $(core)/plaincon.o $(core)/strcasecmp.o,$(CORE_COBJ))
+LIB_OBJS = $(addprefix $(com32)/lib/,$(MINLIBOBJS))
+
+CSRC = $(wildcard *.c)
+OBJ = $(patsubst %.c,%.o,$(CSRC))
+OBJS = $(filter-out wrapper.o,$(OBJ))
+
+OBJS += $(core)/codepage.o
+
+# The targets to build in this directory
+BTARGET = syslinux.efi
+
+syslinux.so: $(OBJS) $(CORE_OBJS) $(LIB_OBJS)
+ $(LD) $(LDFLAGS) -o $@ $^ -lgnuefi -lefi
+
+# We need to rename the .hash section because the EFI firmware
+# linker really doesn't like it.
+# $(OBJCOPY) --rename-section .gnu.hash=.sdata,load,data,alloc $^ $@
+#syslinux.so: syslinux1.so
+# cp $^ $@
+
+wrapper: wrapper.c
+ $(CC) $^ -o $@
+
+#
+# Build the wrapper app and wrap our .so to produce a .efi
+syslinux.efi: syslinux.so wrapper
+ ./wrapper syslinux.so $@
+
+all: $(BTARGET)
+
+$(core)/codepage.o: ../codepage/cp865.cp
+ cp ../codepage/cp865.cp codepage.cp
+ $(CC) $(SFLAGS) -c -o $@ $(core)/codepage.S
+
+tidy dist:
+ rm -f *.so *.o
+ find . \( -name \*.o -o -name \*.a -o -name .\*.d -o -name \*.tmp \) -print0 | \
+ xargs -0r rm -f
+
+clean: tidy
+
+spotless: clean
+ rm -f $(BTARGET)