Skip to contentSkip to conversation

x86: fix make logic of final linking steps

PATCH New Jan Beulich 1 participant 1 message Oct 4, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86: fix make logic of final linking steps

Make sure that if one of the intermediate steps fails, a subsequent make invocation doesn't think there's nothing to do. This should be viewed as an intermediate step towards splitting up the rule into three independent ones, passing intermediate files from one to the next.

xen/arch/x86/Makefile +7 -6
Index: 2006-10-04/xen/arch/x86/Makefile
===================================================================
@@ -49,22 +49,22 @@ $(TARGET): $(TARGET)-syms boot/mkelf32
 	`$(NM) $(TARGET)-syms | sort | tail -n 1 | \
 	 sed -e 's/^\([^ ]*\).*/0x\1/'`
 
-$(TARGET)-syms: boot/$(TARGET_SUBARCH).o $(ALL_OBJS) xen.lds
+$(TARGET)-syms: boot/$(TARGET_SUBARCH).o $(ALL_OBJS) xen.lds Makefile
 	$(MAKE) -f $(BASEDIR)/Rules.mk $(BASEDIR)/common/symbols-dummy.o
 	$(LD) $(LDFLAGS) -T xen.lds -N \
 	    boot/$(TARGET_SUBARCH).o $(ALL_OBJS) \
-	    $(BASEDIR)/common/symbols-dummy.o -o $@
-	$(NM) -n $@ | $(BASEDIR)/tools/symbols >$(BASEDIR)/xen-syms.S
+	    $(BASEDIR)/common/symbols-dummy.o -o $(@D)/.$(@F).0 
+	$(NM) -n $(@D)/.$(@F).0 | $(BASEDIR)/tools/symbols >$(BASEDIR)/xen-syms.S
 	$(MAKE) -f $(BASEDIR)/Rules.mk $(BASEDIR)/xen-syms.o
 	$(LD) $(LDFLAGS) -T xen.lds -N \
 	    boot/$(TARGET_SUBARCH).o $(ALL_OBJS) \
-	    $(BASEDIR)/xen-syms.o -o $@
-	$(NM) -n $@ | $(BASEDIR)/tools/symbols >$(BASEDIR)/xen-syms.S
+	    $(BASEDIR)/xen-syms.o -o $(@D)/.$(@F).1 
+	$(NM) -n $(@D)/.$(@F).1 | $(BASEDIR)/tools/symbols >$(BASEDIR)/xen-syms.S
 	$(MAKE) -f $(BASEDIR)/Rules.mk $(BASEDIR)/xen-syms.o
 	$(LD) $(LDFLAGS) -T xen.lds -N \
 	    boot/$(TARGET_SUBARCH).o $(ALL_OBJS) \
 	    $(BASEDIR)/xen-syms.o -o $@
-	rm -f $(BASEDIR)/xen-syms.S $(BASEDIR)/xen-syms.o
+	rm -f $(BASEDIR)/xen-syms.[So] $(@D)/.$(@F).[0-9] 
 
 asm-offsets.s: $(TARGET_SUBARCH)/asm-offsets.c $(HDRS)
 	$(CC) $(CFLAGS) -S -o $@ $<
@@ -78,3 +78,4 @@ boot/mkelf32: boot/mkelf32.c
 .PHONY: clean
 clean::
 	rm -f asm-offsets.s xen.lds boot/*.o boot/*~ boot/core boot/mkelf32
+	rm -f $(BASEDIR)/xen-syms.[So] $(BASEDIR)/.xen-syms.[0-9]