[PATCH] give nice output when generating barebox.bin and barebox.S

Uwe Kleine-König u.kleine-koenig at pengutronix.de
Fri Mar 12 04:51:21 EST 2010


As a side effect don't build barebox.S when barebox.bin is updated.  I
didn't manage to keep the old behaviour and I consider it cleaner this
way.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig at pengutronix.de>
---
Hello,

I rebased this to current master.  The X86 stuff is untouched, probably
it could be integrated, too, but I didn't want to spend the time trying,
if the patch isn't welcome in principle.  Sascha?

Grüßle
Uwe

 Makefile |   17 ++++++++++++++---
 1 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index 01d2052..8b9b454 100644
--- a/Makefile
+++ b/Makefile
@@ -641,9 +641,16 @@ define rule_barebox-modpost
 	$(Q)echo 'cmd_$@ := $(cmd_barebox-modpost)' > $(dot-target).cmd
 endef
 
-barebox.bin: barebox
-	$(Q)$(OBJCOPY) -O binary barebox barebox.bin
+quiet_cmd_objcopy = OBJCOPY $@
+      cmd_objcopy = $(OBJCOPY) $(OBJCOPYFLAGS) $(OBJCOPYFLAGS_$(@F)) $< $@
+
+OBJCOPYFLAGS_barebox.bin = -O binary
+
+barebox.bin: barebox FORCE
+	$(call if_changed,objcopy)
+
 ifdef CONFIG_X86
+barebox.S: barebox
 ifdef CONFIG_X86_HDBOOT
 	@echo "-------------------------------------------------" > barebox.S
 	@echo " * MBR content" >> barebox.S
@@ -665,7 +672,11 @@ endif
 	@echo " * Init Calls content" >> barebox.S
 	$(Q)$(OBJDUMP) -j .barebox_initcalls -d barebox >> barebox.S
 else
-	$(Q)$(OBJDUMP) -d barebox > barebox.S
+quiet_cmd_disasm = DISASM  $@
+      cmd_disasm = $(OBJDUMP) -d $< > $@
+
+barebox.S: barebox FORCE
+	$(call if_changed,disasm)
 endif
 
 # barebox image
-- 
1.7.0




More information about the barebox mailing list