-ifeq "$(PASS)" "3"
- mv -v /tools/bin/{ld,ld-old}
- mv -v /tools/$(BUILDTARGET)/bin/{ld,ld-old}
- mv -v /tools/bin/{ld-new,ld}
- ln -sv /tools/bin/ld /tools/$(BUILDTARGET)/bin/ld
+ # Set a marker when the toolchain was successfully built
+ touch $(TOOLS_DIR)/.toolchain-successful
+else
+ mv -v $(TOOLS_DIR)/bin/{ld,ld-old}
+ mv -v $(TOOLS_DIR)/$(BUILDTARGET)/bin/{ld,ld-old}
+ mv -v $(TOOLS_DIR)/bin/{ld-new,ld}
+ ln -sv $(TOOLS_DIR)/bin/ld $(TOOLS_DIR)/$(BUILDTARGET)/bin/ld