Replace makebin with objcopy
Replace custom SDCC tool with the more standard binutils tool. scratch.rom and flash.rom are different (no unnecessary padding), but resulting ec.rom is the same. Signed-off-by: Tim Crawford <tcrawford@system76.com>
This commit is contained in:
committed by
Tim Crawford
parent
69f97fe149
commit
d36fb62cd7
@@ -14,7 +14,7 @@ sim: $(BUILD)/ec.rom
|
|||||||
# Convert from Intel Hex file to binary file
|
# Convert from Intel Hex file to binary file
|
||||||
$(BUILD)/ec.rom: $(BUILD)/ec.ihx
|
$(BUILD)/ec.rom: $(BUILD)/ec.ihx
|
||||||
@mkdir -p $(@D)
|
@mkdir -p $(@D)
|
||||||
makebin -s $(CODE_SIZE) -p < $< > $@
|
objcopy -I ihex -O binary --gap-fill=0xFF $< $@
|
||||||
|
|
||||||
# Link object files into Intel Hex file
|
# Link object files into Intel Hex file
|
||||||
$(BUILD)/ec.ihx: $(OBJ)
|
$(BUILD)/ec.ihx: $(OBJ)
|
||||||
|
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
CC=avr-gcc -mmcu=$(EC_VARIANT)
|
CC=avr-gcc -mmcu=$(EC_VARIANT)
|
||||||
CFLAGS+=-Os -fstack-usage -Wall -Werror -Wl,--gc-sections -Wl,-u,vfprintf -lprintf_flt
|
CFLAGS+=-Os -fstack-usage -Wall -Werror -Wl,--gc-sections -Wl,-u,vfprintf -lprintf_flt
|
||||||
|
OBJCOPY = avr-objcopy
|
||||||
OBJ=$(sort $(patsubst src/%.c,$(BUILD)/%.o,$(SRC)))
|
OBJ=$(sort $(patsubst src/%.c,$(BUILD)/%.o,$(SRC)))
|
||||||
|
|
||||||
# Run EC rom in simulator
|
# Run EC rom in simulator
|
||||||
@@ -11,12 +12,12 @@ sim: $(BUILD)/ec.elf
|
|||||||
# Convert from Intel Hex file to binary file
|
# Convert from Intel Hex file to binary file
|
||||||
$(BUILD)/ec.rom: $(BUILD)/ec.ihx
|
$(BUILD)/ec.rom: $(BUILD)/ec.ihx
|
||||||
@mkdir -p $(@D)
|
@mkdir -p $(@D)
|
||||||
makebin -p < $< > $@
|
$(OBJCOPY) -I ihex -O binary --gap-fill 0xFF $< $@
|
||||||
|
|
||||||
# Convert from ELF file to Intel Hex file
|
# Convert from ELF file to Intel Hex file
|
||||||
$(BUILD)/ec.ihx: $(BUILD)/ec.elf
|
$(BUILD)/ec.ihx: $(BUILD)/ec.elf
|
||||||
@mkdir -p $(@D)
|
@mkdir -p $(@D)
|
||||||
avr-objcopy -j .text -j .data -O ihex $< $@
|
$(OBJCOPY) -j .text -j .data -O ihex $< $@
|
||||||
|
|
||||||
# Link object files into ELF file
|
# Link object files into ELF file
|
||||||
$(BUILD)/ec.elf: $(OBJ)
|
$(BUILD)/ec.elf: $(OBJ)
|
||||||
|
@@ -31,12 +31,12 @@ FLASH_CC=\
|
|||||||
# Convert from binary file to C header
|
# Convert from binary file to C header
|
||||||
$(BUILD)/include/flash.h: $(FLASH_BUILD)/flash.rom
|
$(BUILD)/include/flash.h: $(FLASH_BUILD)/flash.rom
|
||||||
@mkdir -p $(@D)
|
@mkdir -p $(@D)
|
||||||
xxd -s $(FLASH_OFFSET) --include < $< > $@
|
xxd -include < $< > $@
|
||||||
|
|
||||||
# Convert from Intel Hex file to binary file
|
# Convert from Intel Hex file to binary file
|
||||||
$(FLASH_BUILD)/flash.rom: $(FLASH_BUILD)/flash.ihx
|
$(FLASH_BUILD)/flash.rom: $(FLASH_BUILD)/flash.ihx
|
||||||
@mkdir -p $(@D)
|
@mkdir -p $(@D)
|
||||||
makebin -p < $< > $@
|
objcopy -I ihex -O binary $< $@
|
||||||
|
|
||||||
# Link object files into Intel Hex file
|
# Link object files into Intel Hex file
|
||||||
$(FLASH_BUILD)/flash.ihx: $(FLASH_OBJ)
|
$(FLASH_BUILD)/flash.ihx: $(FLASH_OBJ)
|
||||||
|
@@ -32,12 +32,12 @@ SCRATCH_CC=\
|
|||||||
# Convert from binary file to C header
|
# Convert from binary file to C header
|
||||||
$(BUILD)/include/scratch.h: $(SCRATCH_BUILD)/scratch.rom
|
$(BUILD)/include/scratch.h: $(SCRATCH_BUILD)/scratch.rom
|
||||||
@mkdir -p $(@D)
|
@mkdir -p $(@D)
|
||||||
xxd -s $(SCRATCH_OFFSET) --include < $< > $@
|
xxd -include < $< > $@
|
||||||
|
|
||||||
# Convert from Intel Hex file to binary file
|
# Convert from Intel Hex file to binary file
|
||||||
$(SCRATCH_BUILD)/scratch.rom: $(SCRATCH_BUILD)/scratch.ihx
|
$(SCRATCH_BUILD)/scratch.rom: $(SCRATCH_BUILD)/scratch.ihx
|
||||||
@mkdir -p $(@D)
|
@mkdir -p $(@D)
|
||||||
makebin -p < $< > $@
|
objcopy -I ihex -O binary $< $@
|
||||||
|
|
||||||
# Link object files into Intel Hex file
|
# Link object files into Intel Hex file
|
||||||
$(SCRATCH_BUILD)/scratch.ihx: $(SCRATCH_OBJ)
|
$(SCRATCH_BUILD)/scratch.ihx: $(SCRATCH_OBJ)
|
||||||
|
Reference in New Issue
Block a user