summaryrefslogtreecommitdiff
path: root/utils/MTP/beastpatcher/Makefile
diff options
context:
space:
mode:
authorDave Chapman <dave@dchapman.com>2009-02-22 13:54:46 +0000
committerDave Chapman <dave@dchapman.com>2009-02-22 13:54:46 +0000
commitc06071e2e705095e49207f92b941edd3b5ada46c (patch)
tree28e6b326720a12f26c56ff098ea12fea50838808 /utils/MTP/beastpatcher/Makefile
parent65d404ff6a78c6e2135f3e4f1f9d5634bed0dfce (diff)
downloadrockbox-c06071e2e705095e49207f92b941edd3b5ada46c.tar.gz
rockbox-c06071e2e705095e49207f92b941edd3b5ada46c.zip
Initial version of a BSD-licensed beastpatcher utility for Gigabeat S installation. Currently only compiles on Linux, but Windows and OS X support are planned.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20083 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'utils/MTP/beastpatcher/Makefile')
-rw-r--r--utils/MTP/beastpatcher/Makefile52
1 files changed, 52 insertions, 0 deletions
diff --git a/utils/MTP/beastpatcher/Makefile b/utils/MTP/beastpatcher/Makefile
new file mode 100644
index 0000000000..edd08b1248
--- /dev/null
+++ b/utils/MTP/beastpatcher/Makefile
@@ -0,0 +1,52 @@
1CFLAGS=-Wall -W
2
3ifeq ($(findstring CYGWIN,$(shell uname)),CYGWIN)
4OUTPUT=beastpatcher.exe
5CROSS=
6else
7OUTPUT=beastpatcher
8CROSS=i586-mingw32msvc-
9endif
10
11ifeq ($(OUTPUT),beastpatcher)
12LIBS = /usr/lib/libmtp.a /usr/lib/libusb.a
13CFLAGS += $(shell printf \
14 '\#include <libmtp.h>\nlibmtp version: LIBMTP_VERSION\n' | \
15 gcc -E -P - -o - | grep -q '^libmtp version: 0\.2' && echo '-DOLDMTP')
16else
17CFLAGS+=-mno-cygwin
18LIBS = ../MTP_DLL.dll
19endif
20
21NATIVECC = gcc
22CC = $(CROSS)gcc
23
24all: $(OUTPUT)
25
26beastpatcher: beastpatcher.c bootimg.c mtp_common.h mtp_libmtp.c
27 gcc $(CFLAGS) -o beastpatcher beastpatcher.c bootimg.c mtp_libmtp.c $(LIBS)
28 strip beastpatcher
29
30beastpatcher.exe: beastpatcher.c bootimg.c mtp_common.h mtp_win32.c $(LIBS)
31 $(CROSS)$(CC) $(CFLAGS) $(LIBS) -o beastpatcher.exe beastpatcher.c bootimg.c
32 $(CROSS)strip beastpatcher.exe
33
34beastpatcher-mac: beastpatcher-i386 beastpatcher-ppc
35 lipo -create beastpatcher-ppc beastpatcher-i386 -output beastpatcher-mac
36
37beastpatcher-i386: beastpatcher.c bootimg.c usb.h libusb-i386.a
38 $(CC) -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -framework iokit -framework coreservices -arch i386 $(CFLAGS) -o beastpatcher-i386 beastpatcher.c bootimg.c -I. libusb-i386.a
39 strip beastpatcher-i386
40
41beastpatcher-ppc: beastpatcher.c bootimg.c usb.h libusb-ppc.a
42 $(CC) -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -framework iokit -framework coreservices -arch ppc $(CFLAGS) -o beastpatcher-ppc beastpatcher.c bootimg.c -I. libusb-ppc.a
43 strip beastpatcher-ppc
44
45bin2c: ../../../rbutil/sansapatcher/bin2c.c
46 $(NATIVECC) $(CFLAGS) -o bin2c ../../../rbutil/sansapatcher/bin2c.c
47
48bootimg.c: bootloader.bin bin2c
49 ./bin2c bootloader.bin bootimg
50
51clean:
52 rm -f beastpatcher.exe beastpatcher-mac beastpatcher-i386 beastpatcher-ppc beastpatcher bin2c bootimg.c bootimg.h *~