From: Ahmad Fatoum <[email protected]>

On sandbox, .old_version is created and removed by the barebox.o recipe
and the barebox ELF itself is never built and instead it's a symlink
created by the barebox__ rule override.

Drop the rm -f .old_version in that case, so the file is not removed too soon.

A cleaner way would be to factor this logic out to a shell script like
Linux does as it's serialized anyway and there's no benefit of having
the steps as make targets, but that's left as future exercise.

Signed-off-by: Ahmad Fatoum <[email protected]>
Link: https://lore.barebox.org/[email protected]
Signed-off-by: Sascha Hauer <[email protected]>
(cherry picked from commit d0c80df5b5378fca1e5f21387a5597ad9555ad40)
Signed-off-by: Ahmad Fatoum <[email protected]>
---
 Makefile | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Makefile b/Makefile
index a6bff68a30e3..cc83061fccab 100644
--- a/Makefile
+++ b/Makefile
@@ -1047,7 +1047,9 @@ PHONY += install
 # barebox image
 barebox: $(BAREBOX_LDS) $(BAREBOX_OBJS) $(kallsyms.o) FORCE
        $(call if_changed_rule,barebox__)
+ifeq ($(BAREBOX_PROPER),barebox)
        $(Q)rm -f .old_version
+endif
 
 barebox.fit: images/barebox-$(CONFIG_ARCH_LINUX_NAME).fit
        $(Q)ln -fsn $< $@
-- 
2.47.3


Reply via email to