]> code.delx.au - refind/blobdiff - filesystems/Make.gnuefi
More flexible packaging script.
[refind] / filesystems / Make.gnuefi
index 3b99878fb047a49ce91619fb12e4766fc384bce6..6eab253332b6d5e79dd3fb168df5713cc2081bae 100644 (file)
@@ -3,6 +3,11 @@
 # Build control file for the EFI drivers, as built with GNU-EFI
 #
 
+# This program is licensed under the terms of the GNU GPL, version 3,
+# or (at your option) any later version.
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
 SRCDIR = .
 
 VPATH = $(SRCDIR)
@@ -19,7 +24,7 @@ endif
 
 ifeq ($(ARCH),ia32)
   LIBEG = build32
-  ARCH_C_FLAGS = -m32 -malign-double
+  ARCH_C_FLAGS = -m32 
   FILENAME_CODE = ia32
   LD_CODE = elf_i386
 endif
@@ -31,6 +36,14 @@ ifeq ($(ARCH),x86_64)
   LD_CODE = elf_x86_64
 endif
 
+ifeq ($(ARCH),aarch64)
+  LIBEG = build64
+  ARCH_C_FLAGS = 
+  FILENAME_CODE = aa64
+  LD_CODE = elf_aarch64
+  FORMAT_DRIVER = -O binary
+endif
+
 LOCAL_CPPFLAGS   = -DFSTYPE=$(DRIVERNAME) $(ARCH_C_FLAGS) -I$(SRCDIR) -I$(SRCDIR)/../include -I$(SRCDIR)/../libeg
 
 OBJS            = fsw_core.o fsw_efi.o fsw_efi_lib.o fsw_lib.o fsw_$(DRIVERNAME).o
@@ -40,9 +53,13 @@ all: $(TARGET)
 
 include $(SRCDIR)/../Make.common
 
+$(SHLIB_TARGET): $(OBJS)
+       $(LD) $(LOCAL_LDFLAGS) $(DRV_LDFLAGS) $(OBJS) -o $@ $(LOCAL_LIBS) $(LIBS)
+
 $(TARGET): $(SHLIB_TARGET)
        $(OBJCOPY) -j .text -j .sdata -j .data -j .dynamic -j .dynsym -j .rel \
-                  -j .rela -j .reloc --target=$(FORMAT_DRIVER)  $< $@
+                  -j .rela -j .rel.* -j .rela.* -j .rel* -j .rela* \
+                  -j .reloc $(FORMAT_DRIVER) $< $@
        chmod a-x $(TARGET)
        mkdir -p ../drivers_$(FILENAME_CODE)
        cp $(TARGET) ../drivers_$(FILENAME_CODE)