summaryrefslogtreecommitdiffstats
path: root/rbutil/e200rpatcher/Makefile
diff options
context:
space:
mode:
authorDave Chapman <dave@dchapman.com>2007-09-09 13:30:40 +0000
committerDave Chapman <dave@dchapman.com>2007-09-09 13:30:40 +0000
commitdd998b7f94a18b1af83334457cff7129e7791258 (patch)
tree05f3c4469dc1a3e1f9ae76dc7047b7437a2850e0 /rbutil/e200rpatcher/Makefile
parentcce117240c8f647aa0aee19c93b5f149e99fdc61 (diff)
downloadrockbox-dd998b7f94a18b1af83334457cff7129e7791258.tar.gz
rockbox-dd998b7f94a18b1af83334457cff7129e7791258.tar.bz2
rockbox-dd998b7f94a18b1af83334457cff7129e7791258.zip
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
Diffstat (limited to 'rbutil/e200rpatcher/Makefile')
-rw-r--r--rbutil/e200rpatcher/Makefile44
1 files changed, 44 insertions, 0 deletions
diff --git a/rbutil/e200rpatcher/Makefile b/rbutil/e200rpatcher/Makefile
new file mode 100644
index 0000000000..243b2e6c09
--- /dev/null
+++ b/rbutil/e200rpatcher/Makefile
@@ -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 *~