Dave Chapman | 1aa6cde | 2008-05-11 18:29:53 +0000 | [diff] [blame^] | 1 | |
| 2 | # Change INFILE to point to your original firmware file |
| 3 | INFILE=$(HOME)/FW/AMS/CLIP/m300a-1.1.17A.bin |
| 4 | |
| 5 | # OUTFILE is the file you copy to your device's root and rename to |
| 6 | # (e.g.) m300a.bin |
| 7 | OUTFILE=patched.bin |
| 8 | |
| 9 | |
| 10 | all: amsinfo $(OUTFILE) |
| 11 | |
| 12 | amsinfo: amsinfo.c |
| 13 | gcc -o amsinfo -W -Wall amsinfo.c |
| 14 | |
| 15 | mkamsboot: mkamsboot.c |
| 16 | gcc -o mkamsboot -W -Wall mkamsboot.c |
| 17 | |
| 18 | # Rules for our test ARM application - assemble, link, then extract |
| 19 | # the binary code |
| 20 | |
| 21 | test.o: test.S |
| 22 | arm-elf-as -o test.o test.S |
| 23 | |
| 24 | test.elf: test.o |
| 25 | arm-elf-ld -e 0 -o test.elf test.o |
| 26 | |
| 27 | test.bin: test.elf |
| 28 | arm-elf-objcopy -O binary test.elf test.bin |
| 29 | |
| 30 | $(OUTFILE): mkamsboot test.bin $(INFILE) |
| 31 | ./mkamsboot $(INFILE) test.bin $(OUTFILE) |
| 32 | |
| 33 | clean: |
| 34 | rm -fr amsinfo mkamsboot test.bin test.o test.elf $(OUTFILE) *~ |