Rather than preparing the efi source file, we will copy them as needed
from the build location.

Avoid the links as they seems fragile in out-of-tree builds. Also by
making a copy, we don't need to figure out the relative path or we
don't need to use absolute path.

Signed-off-by: Anthony PERARD <anthony.per...@citrix.com>
---
 xen/Makefile              | 5 -----
 xen/arch/arm/efi/Makefile | 6 ++++++
 xen/arch/x86/efi/Makefile | 6 ++++++
 3 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/xen/Makefile b/xen/Makefile
index 950bee10ba38..4c1dd9ce2ea1 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -425,11 +425,6 @@ $(TARGET).gz: $(TARGET)
 $(TARGET): tools_fixdep FORCE
        $(MAKE) $(build)=tools
        $(MAKE) $(build)=. include/xen/compile.h
-       [ -e arch/$(TARGET_ARCH)/efi ] && for f in $$(cd common/efi; echo 
*.[ch]); \
-               do test -r arch/$(TARGET_ARCH)/efi/$$f || \
-                  ln -nsf ../../../common/efi/$$f arch/$(TARGET_ARCH)/efi/; \
-               done; \
-               true
        $(MAKE) $(build)=include all
        $(MAKE) $(build)=arch/$(TARGET_ARCH) include
        $(MAKE) $(build)=. arch/$(TARGET_ARCH)/include/asm/asm-offsets.h
diff --git a/xen/arch/arm/efi/Makefile b/xen/arch/arm/efi/Makefile
index 1b1ed06feddc..36e15ac280cd 100644
--- a/xen/arch/arm/efi/Makefile
+++ b/xen/arch/arm/efi/Makefile
@@ -1,4 +1,10 @@
 CFLAGS-y += -fshort-wchar
+CFLAGS-y += -I$(srctree)/common/efi
 
 obj-y += boot.init.o pe.init.o ebmalloc.o runtime.o
 obj-$(CONFIG_ACPI) +=  efi-dom0.init.o
+
+$(obj)/%.c: common/efi/%.c
+       $(Q)cp -f $< $@
+
+.PRECIOUS: $(obj)/%.c
diff --git a/xen/arch/x86/efi/Makefile b/xen/arch/x86/efi/Makefile
index ac815f02cb5e..da05935a9348 100644
--- a/xen/arch/x86/efi/Makefile
+++ b/xen/arch/x86/efi/Makefile
@@ -1,4 +1,5 @@
 CFLAGS-y += -fshort-wchar
+CFLAGS-y += -I$(srctree)/common/efi
 
 quiet_cmd_objcopy_o_ihex = OBJCOPY $@
 cmd_objcopy_o_ihex = $(OBJCOPY) -I ihex -O binary $< $@
@@ -19,3 +20,8 @@ obj-$(XEN_BUILD_EFI) := $(filter-out %.init.o,$(EFIOBJ-y))
 obj-bin-$(XEN_BUILD_EFI) := $(filter %.init.o,$(EFIOBJ-y))
 extra-$(XEN_BUILD_EFI) += buildid.o relocs-dummy.o
 nocov-$(XEN_BUILD_EFI) += stub.o
+
+$(obj)/%.c: common/efi/%.c
+       $(Q)cp -f $< $@
+
+.PRECIOUS: $(obj)/%.c
-- 
Anthony PERARD


Reply via email to