92e002
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
92e002
From: Peter Jones <pjones@redhat.com>
92e002
Date: Fri, 25 Oct 2019 15:42:10 -0400
92e002
Subject: [PATCH] Install all headers for all arches.
92e002
92e002
This further enables cross-builds by installing all the arches headers.
92e002
92e002
Signed-off-by: Peter Jones <pjones@redhat.com>
92e002
---
92e002
 inc/Makefile | 17 ++++++++++-------
92e002
 1 file changed, 10 insertions(+), 7 deletions(-)
92e002
92e002
diff --git a/inc/Makefile b/inc/Makefile
92e002
index 445d340f0fa..e8123fd3115 100644
92e002
--- a/inc/Makefile
92e002
+++ b/inc/Makefile
92e002
@@ -9,15 +9,18 @@ all:
92e002
 
92e002
 clean:
92e002
 
92e002
+SOURCE=$(realpath $(SRCDIR))
92e002
+DEST=$(INSTALLROOT)$(PREFIX)/include/efi
92e002
+INCLUDEDIRS=$(sort $(shell find $(SOURCE) -type d))
92e002
+
92e002
 install:
92e002
-	mkdir -p $(INSTALLROOT)$(PREFIX)/include/efi
92e002
-	mkdir -p $(INSTALLROOT)$(PREFIX)/include/efi/protocol
92e002
-	mkdir -p $(INSTALLROOT)$(PREFIX)/include/efi/$(ARCH)
92e002
-	$(INSTALL) -m 644 $(SRCDIR)/*.h $(INSTALLROOT)$(PREFIX)/include/efi
92e002
-	$(INSTALL) -m 644 $(SRCDIR)/protocol/*.h $(INSTALLROOT)$(PREFIX)/include/efi/protocol
92e002
-	$(INSTALL) -m 644 $(SRCDIR)/$(ARCH)/*.h $(INSTALLROOT)$(PREFIX)/include/efi/$(ARCH)
92e002
+	@$(foreach d,$(INCLUDEDIRS), \
92e002
+		$(INSTALL) -v -m 755 -d $(subst $(SOURCE),$(DEST),$(d)); \
92e002
+		$(INSTALL) -v -m 644 -t $(subst $(SOURCE),$(DEST),$(d)) $(wildcard $(d)/*.h); \
92e002
+	)
92e002
 
92e002
 install_compat: install
92e002
-	@if [ ! -h $(DEST)/$(BFD_ARCH) ]; then $(SYMLINK) $(ARCH) $(INSTALLROOT)$(PREFIX)/include/efi/$(BFD_ARCH) ; fi
92e002
+	@if [ ! -h $(DEST)/x86_64 ]; then $(SYMLINK) x64/ $(DEST)/x86_64 ; fi
92e002
+	@if [ ! -h $(DEST)/aarch64 ]; then $(SYMLINK) aa64/ $(DEST)/aarch64 ; fi
92e002
 
92e002
 include $(SRCDIR)/../Make.rules