|
|
4c0d37 |
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
4c0d37 |
From: Peter Jones <pjones@redhat.com>
|
|
|
4c0d37 |
Date: Fri, 25 Oct 2019 15:41:16 -0400
|
|
|
4c0d37 |
Subject: [PATCH] Install our libraries in $(LIBDIR)/gnuefi/$(ARCH)
|
|
|
4c0d37 |
|
|
|
4c0d37 |
This makes it possible to install all the output on the same machine for
|
|
|
4c0d37 |
cross-builds. This also adds "install_compat", which uses the previous
|
|
|
4c0d37 |
paths.
|
|
|
4c0d37 |
|
|
|
4c0d37 |
Signed-off-by: Peter Jones <pjones@redhat.com>
|
|
|
4c0d37 |
---
|
|
|
4c0d37 |
Make.defaults | 1 +
|
|
|
4c0d37 |
Makefile | 4 ++--
|
|
|
4c0d37 |
apps/Makefile | 2 +-
|
|
|
4c0d37 |
gnuefi/Makefile | 22 ++++++++++++++++++----
|
|
|
4c0d37 |
inc/Makefile | 3 +++
|
|
|
4c0d37 |
lib/Makefile | 5 ++++-
|
|
|
4c0d37 |
6 files changed, 29 insertions(+), 8 deletions(-)
|
|
|
4c0d37 |
|
|
|
4c0d37 |
diff --git a/Make.defaults b/Make.defaults
|
|
|
4c0d37 |
index 157559d20ee..7231e9bced2 100755
|
|
|
4c0d37 |
--- a/Make.defaults
|
|
|
4c0d37 |
+++ b/Make.defaults
|
|
|
4c0d37 |
@@ -72,6 +72,7 @@ LD := $(prefix)$(CROSS_COMPILE)ld
|
|
|
4c0d37 |
AR := $(prefix)$(CROSS_COMPILE)ar
|
|
|
4c0d37 |
RANLIB := $(prefix)$(CROSS_COMPILE)ranlib
|
|
|
4c0d37 |
OBJCOPY := $(prefix)$(CROSS_COMPILE)objcopy
|
|
|
4c0d37 |
+SYMLINK := ln -vfs
|
|
|
4c0d37 |
|
|
|
4c0d37 |
|
|
|
4c0d37 |
# Host/target identification
|
|
|
4c0d37 |
diff --git a/Makefile b/Makefile
|
|
|
4c0d37 |
index eecce6d9736..962ac72b664 100644
|
|
|
4c0d37 |
--- a/Makefile
|
|
|
4c0d37 |
+++ b/Makefile
|
|
|
4c0d37 |
@@ -87,10 +87,10 @@ clean:
|
|
|
4c0d37 |
fi; \
|
|
|
4c0d37 |
done
|
|
|
4c0d37 |
|
|
|
4c0d37 |
-install:
|
|
|
4c0d37 |
+install install_compat:
|
|
|
4c0d37 |
@set -e ; for d in $(SUBDIRS); do \
|
|
|
4c0d37 |
mkdir -p $(OBJDIR)/$$d; \
|
|
|
4c0d37 |
- $(MAKE) -C $(OBJDIR)/$$d -f $(SRCDIR)/$$d/Makefile SRCDIR=$(SRCDIR)/$$d install; done
|
|
|
4c0d37 |
+ $(MAKE) -C $(OBJDIR)/$$d -f $(SRCDIR)/$$d/Makefile SRCDIR=$(SRCDIR)/$$d $@ ; done
|
|
|
4c0d37 |
|
|
|
4c0d37 |
.PHONY: $(SUBDIRS) clean depend
|
|
|
4c0d37 |
|
|
|
4c0d37 |
diff --git a/apps/Makefile b/apps/Makefile
|
|
|
4c0d37 |
index 3b96f153a23..8ab83d58a3c 100644
|
|
|
4c0d37 |
--- a/apps/Makefile
|
|
|
4c0d37 |
+++ b/apps/Makefile
|
|
|
4c0d37 |
@@ -91,6 +91,6 @@ ctors_test.so : ctors_fns.o ctors_test.o
|
|
|
4c0d37 |
clean:
|
|
|
4c0d37 |
@rm -vf $(TARGETS) *~ *.o *.so
|
|
|
4c0d37 |
|
|
|
4c0d37 |
-.PHONY: install
|
|
|
4c0d37 |
+.PHONY: install install_compat
|
|
|
4c0d37 |
|
|
|
4c0d37 |
include $(SRCDIR)/../Make.rules
|
|
|
4c0d37 |
diff --git a/gnuefi/Makefile b/gnuefi/Makefile
|
|
|
4c0d37 |
index bea629b0b29..7652669a7cc 100644
|
|
|
4c0d37 |
--- a/gnuefi/Makefile
|
|
|
4c0d37 |
+++ b/gnuefi/Makefile
|
|
|
4c0d37 |
@@ -60,16 +60,30 @@ clean:
|
|
|
4c0d37 |
@rm -vf $(TARGETS) *~ *.o $(OBJS)
|
|
|
4c0d37 |
|
|
|
4c0d37 |
install:
|
|
|
4c0d37 |
+ mkdir -p $(INSTALLROOT)$(LIBDIR)/gnuefi/$(ARCH)
|
|
|
4c0d37 |
+ $(INSTALL) -m 644 -t $(INSTALLROOT)$(LIBDIR)/gnuefi/$(ARCH)/ $(TARGETS)
|
|
|
4c0d37 |
+ifneq (,$(findstring FreeBSD,$(OS)))
|
|
|
4c0d37 |
+ ifeq ($(ARCH),x64)
|
|
|
4c0d37 |
+ $(INSTALL) -m 644 $(SRCDIR)/elf_$(ARCH)_fbsd_efi.lds $(INSTALLROOT)$(LIBDIR)/gnuefi/$(ARCH)
|
|
|
4c0d37 |
+ else
|
|
|
4c0d37 |
+ $(INSTALL) -m 644 $(SRCDIR)/elf_$(ARCH)_efi.lds $(INSTALLROOT)$(LIBDIR)/gnuefi/$(ARCH)
|
|
|
4c0d37 |
+ endif
|
|
|
4c0d37 |
+else
|
|
|
4c0d37 |
+ $(INSTALL) -m 644 $(SRCDIR)/elf_$(ARCH)_efi.lds $(INSTALLROOT)$(LIBDIR)/gnuefi/$(ARCH)
|
|
|
4c0d37 |
+endif
|
|
|
4c0d37 |
+
|
|
|
4c0d37 |
+install_compat: install
|
|
|
4c0d37 |
mkdir -p $(INSTALLROOT)$(LIBDIR)
|
|
|
4c0d37 |
- $(INSTALL) -m 644 $(TARGETS) $(INSTALLROOT)$(LIBDIR)
|
|
|
4c0d37 |
+ $(SYMLINK) gnuefi/$(ARCH)/libgnuefi.a $(INSTALLROOT)$(LIBDIR)/libgnuefi.a
|
|
|
4c0d37 |
+ $(SYMLINK) gnuefi/$(ARCH)/crt0-efi-$(ARCH).o $(INSTALLROOT)$(LIBDIR)/crt0-efi-$(BFD_ARCH).o
|
|
|
4c0d37 |
ifneq (,$(findstring FreeBSD,$(OS)))
|
|
|
4c0d37 |
ifeq ($(ARCH),x64)
|
|
|
4c0d37 |
- $(INSTALL) -m 644 $(SRCDIR)/elf_$(ARCH)_fbsd_efi.lds $(INSTALLROOT)$(LIBDIR)
|
|
|
4c0d37 |
+ $(SYMLINK) gnuefi/$(ARCH)/elf_$(ARCH)_fbsd_efi.lds $(INSTALLROOT)$(LIBDIR)/elf_$(BFD_ARCH)_fbsd_efi.lds
|
|
|
4c0d37 |
else
|
|
|
4c0d37 |
- $(INSTALL) -m 644 $(SRCDIR)/elf_$(ARCH)_efi.lds $(INSTALLROOT)$(LIBDIR)
|
|
|
4c0d37 |
+ $(SYMLINK) gnuefi/$(ARCH)/elf_$(ARCH)_efi.lds $(INSTALLROOT)$(LIBDIR)/elf_$(BFD_ARCH)_efi.lds
|
|
|
4c0d37 |
endif
|
|
|
4c0d37 |
else
|
|
|
4c0d37 |
- $(INSTALL) -m 644 $(SRCDIR)/elf_$(ARCH)_efi.lds $(INSTALLROOT)$(LIBDIR)
|
|
|
4c0d37 |
+ $(SYMLINK) gnuefi/$(ARCH)/elf_$(ARCH)_efi.lds $(INSTALLROOT)$(LIBDIR)/elf_$(BFD_ARCH)_efi.lds
|
|
|
4c0d37 |
endif
|
|
|
4c0d37 |
|
|
|
4c0d37 |
include $(SRCDIR)/../Make.rules
|
|
|
4c0d37 |
diff --git a/inc/Makefile b/inc/Makefile
|
|
|
4c0d37 |
index 13022fd6ae1..445d340f0fa 100644
|
|
|
4c0d37 |
--- a/inc/Makefile
|
|
|
4c0d37 |
+++ b/inc/Makefile
|
|
|
4c0d37 |
@@ -17,4 +17,7 @@ install:
|
|
|
4c0d37 |
$(INSTALL) -m 644 $(SRCDIR)/protocol/*.h $(INSTALLROOT)$(PREFIX)/include/efi/protocol
|
|
|
4c0d37 |
$(INSTALL) -m 644 $(SRCDIR)/$(ARCH)/*.h $(INSTALLROOT)$(PREFIX)/include/efi/$(ARCH)
|
|
|
4c0d37 |
|
|
|
4c0d37 |
+install_compat: install
|
|
|
4c0d37 |
+ @if [ ! -h $(DEST)/$(BFD_ARCH) ]; then $(SYMLINK) $(ARCH) $(INSTALLROOT)$(PREFIX)/include/efi/$(BFD_ARCH) ; fi
|
|
|
4c0d37 |
+
|
|
|
4c0d37 |
include $(SRCDIR)/../Make.rules
|
|
|
4c0d37 |
diff --git a/lib/Makefile b/lib/Makefile
|
|
|
4c0d37 |
index 6dca2cf1398..f0d7b9b08e6 100644
|
|
|
4c0d37 |
--- a/lib/Makefile
|
|
|
4c0d37 |
+++ b/lib/Makefile
|
|
|
4c0d37 |
@@ -66,7 +66,7 @@ OBJS = $(FILES:%=%.o) ctors.o
|
|
|
4c0d37 |
|
|
|
4c0d37 |
SUBDIRS = $(ARCHES) runtime
|
|
|
4c0d37 |
|
|
|
4c0d37 |
-LIBDIRINSTALL = $(INSTALLROOT)$(LIBDIR)
|
|
|
4c0d37 |
+LIBDIRINSTALL ?= $(INSTALLROOT)$(LIBDIR)/gnuefi/$(ARCH)
|
|
|
4c0d37 |
|
|
|
4c0d37 |
all: libsubdirs libefi.a
|
|
|
4c0d37 |
|
|
|
4c0d37 |
@@ -88,6 +88,9 @@ $(LIBDIRINSTALL)/libefi.a: libefi.a | $(LIBDIRINSTALL)
|
|
|
4c0d37 |
|
|
|
4c0d37 |
install: $(LIBDIRINSTALL)/libefi.a
|
|
|
4c0d37 |
|
|
|
4c0d37 |
+install_compat: install
|
|
|
4c0d37 |
+ $(SYMLINK) gnuefi/$(ARCH)/libefi.a $(INSTALLROOT)$(LIBDIR)/libefi.a
|
|
|
4c0d37 |
+
|
|
|
4c0d37 |
include $(SRCDIR)/../Make.rules
|
|
|
4c0d37 |
|
|
|
4c0d37 |
.PHONY: libsubdirs
|