Patchwork [v2] optionroms: Silence intermediate file removal

login
register
mail settings
Submitter Jan Kiszka
Date Jan. 27, 2012, 12:26 p.m.
Message ID <4F2297FB.2040508@siemens.com>
Download mbox | patch
Permalink /patch/138219/
State New
Headers show

Comments

Jan Kiszka - Jan. 27, 2012, 12:26 p.m.
The build process of optionroms spits out an "rm ..." line. Moreover, it
removes all .o files that can be handy for debugging purposes.

Disable automatic intermediate removal and only clean up the unneeded
and large .img and .raw files.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---

Changes in v2:
 - comment on .SECONDARY purpose
 - make rm -rf dependent on success of build command

 pc-bios/optionrom/Makefile |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
Andreas Färber - Jan. 27, 2012, 1:24 p.m.
Am 27.01.2012 13:26, schrieb Jan Kiszka:
> The build process of optionroms spits out an "rm ..." line. Moreover, it
> removes all .o files that can be handy for debugging purposes.
> 
> Disable automatic intermediate removal and only clean up the unneeded
> and large .img and .raw files.
> 
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>

Reviewed-by: Andreas Färber <afaerber@suse.de>

Thanks,
Andreas

Patch

diff --git a/pc-bios/optionrom/Makefile b/pc-bios/optionrom/Makefile
index 51da288..4e7275b 100644
--- a/pc-bios/optionrom/Makefile
+++ b/pc-bios/optionrom/Makefile
@@ -16,14 +16,17 @@  QEMU_CFLAGS = $(CFLAGS)
 
 build-all: multiboot.bin linuxboot.bin
 
+# suppress auto-removal of intermediate files
+.SECONDARY:
+
 %.img: %.o
 	$(call quiet-command,$(LD) -Ttext 0 -e _start -s -o $@ $<,"  Building $(TARGET_DIR)$@")
 
 %.raw: %.img
-	$(call quiet-command,$(OBJCOPY) -O binary -j .text $< $@,"  Building $(TARGET_DIR)$@")
+	$(call quiet-command,$(OBJCOPY) -O binary -j .text $< $@ && rm -f $<,"  Building $(TARGET_DIR)$@")
 
 %.bin: %.raw
-	$(call quiet-command,$(SHELL) $(SRC_PATH)/scripts/signrom.sh $< $@,"  Signing $(TARGET_DIR)$@")
+	$(call quiet-command,$(SHELL) $(SRC_PATH)/scripts/signrom.sh $< $@ && rm -f $<,"  Signing $(TARGET_DIR)$@")
 
 clean:
 	rm -f *.o *.d *.raw *.img *.bin *~