[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [RFC XEN PATCH 13/23] convert common/libelf/Makefile to kbuild makefile


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • Date: Wed, 23 Oct 2019 17:48:27 +0100
  • Authentication-results: esa3.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=anthony.perard@xxxxxxxxxx; spf=Pass smtp.mailfrom=anthony.perard@xxxxxxxxxx; spf=None smtp.helo=postmaster@xxxxxxxxxxxxxxx
  • Cc: Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • Delivery-date: Wed, 23 Oct 2019 17:10:36 +0000
  • Ironport-sdr: GLFrNqBW108BBvu4r1iGnJRky+GBLZZfFMfeX0mI8i22tin7b/QhBPpoIj/13S5EvivOFkfdxJ bGtPSVBNJDcFh2dG0VzzTltwUSI1tQKKl5WC+9viXN0FtFDpuZ+wWcRUxCHVCMr1nWsNJg9R0O u0WhDSfo04FEdN9VZBrRvyhbIXPP0HtT23DixVo3B9612F1BMheWLH0Z4zFUoScB8ttpLo4Ogn V5vIkJWYHgt2RDXBj9toneBLOlDMTnWoaRmSMyVF5qtzSgsHGPbBuBgJadt9ppDoB/8B/cWQuT rr0=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Use existing command line of objcopy and ld instead of writing new one
and simply edit the flags.

`targets' is to let know kbuild that other files beside the one
declared in obj-bin-y will be built.

Signed-off-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
---
 xen/common/libelf/Makefile | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/xen/common/libelf/Makefile b/xen/common/libelf/Makefile
index 9a433f01fbd4..2be9ea82b241 100644
--- a/xen/common/libelf/Makefile
+++ b/xen/common/libelf/Makefile
@@ -4,9 +4,14 @@ nocov-y += libelf.o
 SECTIONS := text data $(SPECIAL_DATA_SECTIONS)
 
 ccflags-y += -Wno-pointer-sign
+ldflags-y += -r
+OBJCOPYFLAGS += $(foreach s,$(SECTIONS),--rename-section .$(s)=.init.$(s))
 
-libelf.o: libelf-temp.o Makefile
-       $(OBJCOPY) $(foreach s,$(SECTIONS),--rename-section .$(s)=.init.$(s)) 
$< $@
+libelf-temp-objs := libelf-tools.o libelf-loader.o libelf-dominfo.o 
#libelf-relocate.o
+targets += $(libelf-temp-objs) libelf-temp.o
 
-libelf-temp.o: libelf-tools.o libelf-loader.o libelf-dominfo.o 
#libelf-relocate.o
-       $(LD) $(LDFLAGS) -r -o $@ $^
+$(obj)/libelf.o: $(obj)/libelf-temp.o FORCE
+       $(call if_changed,objcopy)
+
+$(obj)/libelf-temp.o: $(addprefix $(obj)/,$(libelf-temp-objs)) FORCE
+       $(call if_changed,ld)
-- 
Anthony PERARD

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.