Browse Source

Split the objcopy stage out of final image preparation to a separate

bin/%.bin target.
tags/v0.9.3
Michael Brown 17 years ago
parent
commit
37fa9a8706
2 changed files with 11 additions and 3 deletions
  1. 1
    0
      src/Makefile
  2. 10
    3
      src/Makefile.housekeeping

+ 1
- 0
src/Makefile View File

@@ -73,6 +73,7 @@ CPP		?= gcc -E -Wp,-Wall
73 73
 RM		?= rm -f
74 74
 TOUCH		?= touch
75 75
 MKDIR		?= mkdir
76
+CP		?= cp
76 77
 PERL		?= /usr/bin/perl
77 78
 CC		?= $(CROSS_COMPILE)gcc
78 79
 AS		?= $(CROSS_COMPILE)as

+ 10
- 3
src/Makefile.housekeeping View File

@@ -307,6 +307,12 @@ $(BIN)/%.tmp : $(BLIB) $(MAKEDEPS) $(LDSCRIPT)
307 307
 $(BIN)/%.map : $(BIN)/%.tmp
308 308
 	@less $(BIN)/$*.tmp.map
309 309
 
310
+# Build raw binary file from intermediate object file
311
+#
312
+$(BIN)/%.bin : $(BIN)/%.tmp
313
+	$(QM)echo "  [BIN] $@"
314
+	$(Q)$(OBJCOPY) -O binary $< $@
315
+
310 316
 # Build bochs symbol table
311 317
 $(BIN)/%.bxs : $(BIN)/%.tmp
312 318
 	$(NM) $< | cut -d" " -f1,3 > $@
@@ -350,9 +356,10 @@ define media_template
350 356
 	@$(MKDIR) -p $(dir $(2))
351 357
 	@$(RM) $(2)
352 358
 	@$(TOUCH) $(2)
353
-	@echo -e '$$(BIN)/%$(1) : $$(BIN)/%$(1).tmp' \
354
-		  '\n\t$$(OBJCOPY) -O binary $$< $$@' \
355
-		  '\n\t$$(FINALISE_$(1))' \
359
+	@echo -e '$$(BIN)/%$(1) : $$(BIN)/%$(1).bin' \
360
+		  '\n\t$$(QM)echo "  [FINISH] $$@"' \
361
+		  '\n\t$$(Q)$$(CP) $$< $$@' \
362
+		  '\n\t$$(Q)$$(FINALISE_$(1))' \
356 363
 		> $(2)
357 364
 
358 365
 endef

Loading…
Cancel
Save