3 ifeq ($(findstring CYGWIN
,$(shell uname
)),CYGWIN
)
4 OUTPUT
=beastpatcher.exe
8 ifeq ($(findstring MINGW
,$(shell uname
)),MINGW
)
9 OUTPUT
=beastpatcher.exe
13 CROSS
=i586-mingw32msvc-
17 ifneq ($(findstring MINGW
,$(shell uname
)),MINGW
)
18 LIBS
= /usr
/lib
/libmtp.a
/usr
/lib
/libusb.a
19 CFLAGS
+= $(shell printf \
20 '\#include <libmtp.h>\nlibmtp version: LIBMTP_VERSION\n' | \
21 gcc
-E
-P
- -o
- | grep
-q
'^libmtp version: 0\.2' && echo
'-DOLDMTP')
23 WINLIBS
= ..
/MTP_DLL.dll
30 beastpatcher
: beastpatcher.c bootimg.c mtp_common.h mtp_libmtp.c
31 gcc
$(CFLAGS
) -o beastpatcher beastpatcher.c bootimg.c mtp_libmtp.c
$(LIBS
)
34 beastpatcher.exe
: beastpatcher.c bootimg.c mtp_common.h mtp_win32.c
$(WINLIBS
)
35 $(CC
) $(CFLAGS
) -o beastpatcher.exe beastpatcher.c bootimg.c mtp_win32.c
$(WINLIBS
)
36 $(CROSS
)strip beastpatcher.exe
38 beastpatcher-mac
: beastpatcher-i386 beastpatcher-ppc
39 lipo
-create beastpatcher-ppc beastpatcher-i386
-output beastpatcher-mac
41 beastpatcher-i386
: beastpatcher.c bootimg.c usb.h libusb-i386.a
42 $(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
43 strip beastpatcher-i386
45 beastpatcher-ppc
: beastpatcher.c bootimg.c usb.h libusb-ppc.a
46 $(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
47 strip beastpatcher-ppc
49 bin2c
: ..
/..
/..
/rbutil
/sansapatcher
/bin2c.c
50 $(NATIVECC
) $(CFLAGS
) -o bin2c ..
/..
/..
/rbutil
/sansapatcher
/bin2c.c
52 bootimg.c
: bootloader.bin bin2c
53 .
/bin2c bootloader.bin bootimg
56 rm -f beastpatcher.exe beastpatcher-mac beastpatcher-i386 beastpatcher-ppc beastpatcher bin2c bootimg.c bootimg.h
*~