From 37fa9a87065e07ccef0fcc62b67db278a337e4a4 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Mon, 16 Jul 2007 13:41:27 +0100 Subject: [PATCH] Split the objcopy stage out of final image preparation to a separate bin/%.bin target. --- src/Makefile | 1 + src/Makefile.housekeeping | 13 ++++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/Makefile b/src/Makefile index ca9cd50e..4f50456a 100644 --- a/src/Makefile +++ b/src/Makefile @@ -73,6 +73,7 @@ CPP ?= gcc -E -Wp,-Wall RM ?= rm -f TOUCH ?= touch MKDIR ?= mkdir +CP ?= cp PERL ?= /usr/bin/perl CC ?= $(CROSS_COMPILE)gcc AS ?= $(CROSS_COMPILE)as diff --git a/src/Makefile.housekeeping b/src/Makefile.housekeeping index c62650e1..12041ce6 100644 --- a/src/Makefile.housekeeping +++ b/src/Makefile.housekeeping @@ -307,6 +307,12 @@ $(BIN)/%.tmp : $(BLIB) $(MAKEDEPS) $(LDSCRIPT) $(BIN)/%.map : $(BIN)/%.tmp @less $(BIN)/$*.tmp.map +# Build raw binary file from intermediate object file +# +$(BIN)/%.bin : $(BIN)/%.tmp + $(QM)echo " [BIN] $@" + $(Q)$(OBJCOPY) -O binary $< $@ + # Build bochs symbol table $(BIN)/%.bxs : $(BIN)/%.tmp $(NM) $< | cut -d" " -f1,3 > $@ @@ -350,9 +356,10 @@ define media_template @$(MKDIR) -p $(dir $(2)) @$(RM) $(2) @$(TOUCH) $(2) - @echo -e '$$(BIN)/%$(1) : $$(BIN)/%$(1).tmp' \ - '\n\t$$(OBJCOPY) -O binary $$< $$@' \ - '\n\t$$(FINALISE_$(1))' \ + @echo -e '$$(BIN)/%$(1) : $$(BIN)/%$(1).bin' \ + '\n\t$$(QM)echo " [FINISH] $$@"' \ + '\n\t$$(Q)$$(CP) $$< $$@' \ + '\n\t$$(Q)$$(FINALISE_$(1))' \ > $(2) endef