UNTESTED
---
 xen/common/libfdt/Makefile | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/xen/common/libfdt/Makefile b/xen/common/libfdt/Makefile
index 9ea5c696d52a..a233d82b15ee 100644
--- a/xen/common/libfdt/Makefile
+++ b/xen/common/libfdt/Makefile
@@ -1,14 +1,16 @@
-include Makefile.libfdt
+include $(srctree)/$(src)/Makefile.libfdt
 
 SECTIONS := text data $(SPECIAL_DATA_SECTIONS)
 
 obj-y += libfdt.o
 nocov-y += libfdt.o
 
-ccflags-y += -I$(BASEDIR)/include/xen/libfdt/
+ccflags-y += -I$(srctree)/include/xen/libfdt/
+ldflags-y += -r
+OBJCOPYFLAGS += $(foreach s,$(SECTIONS),--rename-section .$(s)=.init.$(s))
 
-libfdt.o: libfdt-temp.o Makefile
-       $(OBJCOPY) $(foreach s,$(SECTIONS),--rename-section .$(s)=.init.$(s)) 
$< $@
+$(obj)/libfdt.o: $(obj)/libfdt-temp.o FORCE
+       $(call if_changed,objcopy)
 
-libfdt-temp.o: $(LIBFDT_OBJS)
-       $(LD) $(LDFLAGS) -r -o $@ $^
+$(obj)/libfdt-temp.o: $(addprefix $(obj)/,$(LIBFDT_OBJS)) FORCE
+       $(call if_changed,ld)
-- 
Anthony PERARD

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

Reply via email to