diff options
author | Dave Chapman <dave@dchapman.com> | 2008-10-04 08:46:03 +0000 |
---|---|---|
committer | Dave Chapman <dave@dchapman.com> | 2008-10-04 08:46:03 +0000 |
commit | c6be818212de133da4a51cebcdfee84c6dbae984 (patch) | |
tree | e6e321e0c0437d5a937db7c126be2289f30cb874 /rbutil/mkamsboot/Makefile | |
parent | d16fe2d36a0881a1bf4f65b945087a10962ed33a (diff) | |
download | rockbox-c6be818212de133da4a51cebcdfee84c6dbae984.tar.gz rockbox-c6be818212de133da4a51cebcdfee84c6dbae984.zip |
Move mkamsboot into the rbutil/mkamsboot/ directory - no other changes, so this should still work the same as before.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18706 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'rbutil/mkamsboot/Makefile')
-rw-r--r-- | rbutil/mkamsboot/Makefile | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/rbutil/mkamsboot/Makefile b/rbutil/mkamsboot/Makefile new file mode 100644 index 0000000000..4040c716b5 --- /dev/null +++ b/rbutil/mkamsboot/Makefile @@ -0,0 +1,56 @@ +# Change INFILE to point to your original firmware file +INFILE=$(HOME)/FW/AMS/CLIP/m300a-1.1.17A.bin + +# OUTFILE is the file you copy to your device's root and rename to +# (e.g.) m300a.bin +OUTFILE=patched.bin + +# The uclpack command +UCLPACK=../../tools/uclpack + +all: $(OUTFILE) + +mkamsboot: mkamsboot.c + gcc -o mkamsboot -W -Wall mkamsboot.c + +extract_fw: extract_fw.c + gcc -o extract_fw -W -Wall extract_fw.c + +# Rules for our test ARM application - assemble, link, then extract +# the binary code + +test.o: test.S + arm-elf-as -o test.o test.S + +test.elf: test.o + arm-elf-ld -e 0 -Ttext=0 -o test.elf test.o + +test.bin: test.elf + arm-elf-objcopy -O binary test.elf test.bin + +# Rules for the ucl unpack function - this is inserted in the padding at +# the end of the original firmware block +nrv2e_d8.o: nrv2e_d8.S + arm-elf-gcc -DPURE_THUMB -c -o nrv2e_d8.o nrv2e_d8.S + +# NOTE: this function has no absolute references, so the link address (-e) +# is irrelevant. We just link at address 0. +nrv2e_d8.elf: nrv2e_d8.o + arm-elf-ld -e 0 -Ttext=0 -o nrv2e_d8.elf nrv2e_d8.o + +nrv2e_d8.bin: nrv2e_d8.elf + arm-elf-objcopy -O binary nrv2e_d8.elf nrv2e_d8.bin + +firmware_block.ucl: firmware_block.bin + $(UCLPACK) --best --2e firmware_block.bin firmware_block.ucl + +firmware_block.bin: $(INFILE) extract_fw + ./extract_fw $(INFILE) firmware_block.bin + +$(OUTFILE): mkamsboot firmware_block.ucl test.bin nrv2e_d8.bin $(INFILE) + ./mkamsboot $(INFILE) firmware_block.ucl test.bin nrv2e_d8.bin $(OUTFILE) + +clean: + rm -fr amsinfo mkamsboot test.o test.elf test.bin extract_fw \ + nrv2e_d8.o nrv2e_d8.elf nrv2e_d8.bin firmware_block.bin \ + firmware_block.ucl $(OUTFILE) *~ |