Silcence output of commands in Makefile
parent
71360cc885
commit
5e01ec9f44
20
Makefile
20
Makefile
|
|
@ -1,28 +1,29 @@
|
|||
all:
|
||||
|
||||
QUIET=@
|
||||
orig_fw.hex:
|
||||
@echo "Reading Novatouch firmware to $@..."
|
||||
mspdebug rf2500 "hexout 0x8000 0xffff $@"
|
||||
$(QUIET)mspdebug rf2500 "hexout 0x8000 0xffff $@"
|
||||
|
||||
orig_fw.bin: orig_fw.hex
|
||||
@echo "Converting ihex fw to binary blob..."
|
||||
msp430-objcopy -I ihex -O binary $< $@
|
||||
$(QUIET)msp430-objcopy -I ihex -O binary $< $@
|
||||
|
||||
section_isr.bin: orig_fw.bin
|
||||
@echo "Create isr vectors binary..."
|
||||
dd if=$< of=$@ bs=1 skip=0x7fe0 count=0x20
|
||||
$(QUIET)dd if=$< of=$@ bs=1 skip=0x7fe0 count=0x20
|
||||
|
||||
section_data.bin: orig_fw.bin
|
||||
@echo "Create data section binary..."
|
||||
dd if=$< of=$@ bs=1 count=0x2780
|
||||
$(QUIET)dd if=$< of=$@ bs=1 count=0x2780
|
||||
|
||||
section_data_patch.bin: section_data.bin
|
||||
@echo "Patching firmware..."
|
||||
python patch.py section_data.bin section_data_patch.bin
|
||||
$(QUIET)python patch.py section_data.bin section_data_patch.bin
|
||||
|
||||
# IDA friendly elf file
|
||||
main.o: section_data_patch.bin section_isr.bin
|
||||
msp430-objcopy -I binary -O elf32-msp430 -B msp430:430X \
|
||||
$(QUIET)msp430-objcopy -I binary -O elf32-msp430 -B msp430:430X \
|
||||
--rename-section .data=.text,contents,code,alloc,load,readonly \
|
||||
--change-section-address .data=0x8000 \
|
||||
--add-section .vectors=section_isr.bin \
|
||||
|
|
@ -30,11 +31,14 @@ main.o: section_data_patch.bin section_isr.bin
|
|||
--change-section-address .vectors=0xff80 \
|
||||
--set-start 0x8000 section_data_patch.bin $@
|
||||
|
||||
# The main.o is an relocatable elf which needs to be converted to an actual elf
|
||||
# The main.o is an relocatable elf which we convert to an actual elf
|
||||
# for IDA to like it
|
||||
main.elf: main.o
|
||||
msp430-gcc -O0 -mmcu=msp430f5510 \
|
||||
$(QUIET)msp430-gcc -O0 -mmcu=msp430f5510 \
|
||||
-Wl,--section-start=.text=0x8000 \
|
||||
-Wl,--entry=0x9ca6 \
|
||||
-nostdlib \
|
||||
$< -o $@
|
||||
|
||||
clean:
|
||||
rm *.o *.bin main.elf
|
||||
|
|
|
|||
Loading…
Reference in New Issue