Initial version of standalone e200rpatcher tool to upload and run the e200r patching application to patch the original Sansa bootloader. This requires the patching binary (called bootloader.bin) to be in the e200rpatcher directory when compiling. Currently only tested on Linux.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14656 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Dave Chapman 2007-09-09 13:30:40 +00:00
parent cce117240c
commit dd998b7f94
2 changed files with 255 additions and 0 deletions

View file

@ -0,0 +1,44 @@
CFLAGS=-Wall -W
ifeq ($(findstring CYGWIN,$(shell uname)),CYGWIN)
OUTPUT=e200rpatcher.exe
CROSS=
CFLAGS+=-mno-cygwin
else
OUTPUT=e200rpatcher
CROSS=i586-mingw32msvc-
endif
LIBS = -lusb
NATIVECC = gcc
CC = $(CROSS)gcc
all: $(OUTPUT)
e200rpatcher: e200rpatcher.c bootimg.c
gcc $(CFLAGS) $(LIBS) -o e200rpatcher e200rpatcher.c bootimg.c
strip e200rpatcher
e200rpatcher.exe: e200rpatcher.c bootimg.c
$(CC) $(CFLAGS) $(LIBS) -o e200rpatcher.exe e200rpatcher.c bootimg.c
$(CROSS)strip e200rpatcher.exe
e200rpatcher-mac: e200rpatcher-i386 e200rpatcher-ppc
lipo -create e200rpatcher-ppc e200rpatcher-i386 -output e200rpatcher-mac
e200rpatcher-i386: e200rpatcher.c bootimg.c
gcc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -o bin/i386/program -arch i386 $(CFLAGS) $(LIBS) -o e200rpatcher-i386 e200rpatcher.c bootimg.c
strip e200rpatcher-i386
e200rpatcher-ppc: e200rpatcher.c bootimg.c
gcc -arch ppc $(CFLAGS) $(LIBS) -o e200rpatcher-ppc e200rpatcher.c bootimg.c
strip e200rpatcher-ppc
bin2c: ../sansapatcher/bin2c.c
$(NATIVECC) $(CFLAGS) -o bin2c ../sansapatcher/bin2c.c
bootimg.c: bootloader.bin bin2c
./bin2c bootloader.bin bootimg
clean:
rm -f e200rpatcher.exe e200rpatcher-mac e200rpatcher-i386 e200rpatcher-ppc e200rpatcher bin2c bootimg.c bootimg.h *~