diff options
-rw-r--r-- | rbutil/sansapatcher/Makefile | 13 | ||||
-rw-r--r-- | rbutil/tools/Makefile | 25 | ||||
-rw-r--r-- | rbutil/tools/bin2c.c (renamed from rbutil/sansapatcher/bin2c.c) | 10 | ||||
-rw-r--r-- | utils/MTP/beastpatcher/Makefile | 4 |
4 files changed, 41 insertions, 11 deletions
diff --git a/rbutil/sansapatcher/Makefile b/rbutil/sansapatcher/Makefile index 9c5bec1bdf..98d3971b0e 100644 --- a/rbutil/sansapatcher/Makefile +++ b/rbutil/sansapatcher/Makefile | |||
@@ -42,14 +42,11 @@ sansapatcher-ppc: main.c sansapatcher.c sansaio-posix.c parttypes.h bootimg_c200 | |||
42 | gcc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -arch ppc $(CFLAGS) -o sansapatcher-ppc main.c sansapatcher.c sansaio-posix.c bootimg_c200.c bootimg_e200.c | 42 | gcc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -arch ppc $(CFLAGS) -o sansapatcher-ppc main.c sansapatcher.c sansaio-posix.c bootimg_c200.c bootimg_e200.c |
43 | strip sansapatcher-ppc | 43 | strip sansapatcher-ppc |
44 | 44 | ||
45 | bin2c: bin2c.c | 45 | bootimg_c200.c: firmware.mi4 ../tools/bin2c |
46 | $(NATIVECC) $(CFLAGS) -o bin2c bin2c.c | 46 | ../tools/bin2c firmware.mi4 bootimg_c200 |
47 | 47 | ||
48 | bootimg_c200.c: firmware.mi4 bin2c | 48 | bootimg_e200.c: PP5022.mi4 ../tools/bin2c |
49 | ./bin2c firmware.mi4 bootimg_c200 | 49 | ../tools/bin2c PP5022.mi4 bootimg_e200 |
50 | |||
51 | bootimg_e200.c: PP5022.mi4 bin2c | ||
52 | ./bin2c PP5022.mi4 bootimg_e200 | ||
53 | 50 | ||
54 | clean: | 51 | clean: |
55 | rm -f sansapatcher.exe sansapatcher-mac sansapatcher-i386 sansapatcher-ppc sansapatcher bin2c bootimg_c200.c bootimg_c200.h bootimg_e200.c bootimg_e200.h *~ | 52 | rm -f sansapatcher.exe sansapatcher-mac sansapatcher-i386 sansapatcher-ppc sansapatcher bootimg_c200.c bootimg_c200.h bootimg_e200.c bootimg_e200.h *~ |
diff --git a/rbutil/tools/Makefile b/rbutil/tools/Makefile new file mode 100644 index 0000000000..baafdf84be --- /dev/null +++ b/rbutil/tools/Makefile | |||
@@ -0,0 +1,25 @@ | |||
1 | CFLAGS=-Wall -W -D_LARGEFILE64_SOURCE | ||
2 | |||
3 | ifeq ($(findstring CYGWIN,$(shell uname)),CYGWIN) | ||
4 | CROSS= | ||
5 | CFLAGS+=-mno-cygwin | ||
6 | else | ||
7 | ifeq ($(findstring MINGW,$(shell uname)),MINGW) | ||
8 | CROSS= | ||
9 | else | ||
10 | CROSS=i586-mingw32msvc- | ||
11 | endif | ||
12 | endif | ||
13 | |||
14 | NATIVECC = gcc | ||
15 | CC = $(CROSS)gcc | ||
16 | WINDRES = $(CROSS)windres | ||
17 | |||
18 | |||
19 | all: bin2c | ||
20 | |||
21 | bin2c: bin2c.c | ||
22 | $(NATIVECC) $(CFLAGS) -o bin2c bin2c.c | ||
23 | |||
24 | clean: | ||
25 | $(RM) bin2c bin2c.exe | ||
diff --git a/rbutil/sansapatcher/bin2c.c b/rbutil/tools/bin2c.c index 7b0606912b..75b44d5df7 100644 --- a/rbutil/sansapatcher/bin2c.c +++ b/rbutil/tools/bin2c.c | |||
@@ -23,9 +23,17 @@ | |||
23 | #include <string.h> | 23 | #include <string.h> |
24 | #include <sys/types.h> | 24 | #include <sys/types.h> |
25 | #include <sys/stat.h> | 25 | #include <sys/stat.h> |
26 | #include <unistd.h> | ||
27 | #include <fcntl.h> | 26 | #include <fcntl.h> |
28 | #include <stdlib.h> | 27 | #include <stdlib.h> |
28 | #if !defined(_MSC_VER) | ||
29 | #include <unistd.h> | ||
30 | #else | ||
31 | #include <io.h> | ||
32 | #define snprintf _snprintf | ||
33 | #define open _open | ||
34 | #define close _close | ||
35 | #define read _read | ||
36 | #endif | ||
29 | 37 | ||
30 | #ifndef O_BINARY | 38 | #ifndef O_BINARY |
31 | #define O_BINARY 0 | 39 | #define O_BINARY 0 |
diff --git a/utils/MTP/beastpatcher/Makefile b/utils/MTP/beastpatcher/Makefile index 5f3951d8be..590473a50f 100644 --- a/utils/MTP/beastpatcher/Makefile +++ b/utils/MTP/beastpatcher/Makefile | |||
@@ -49,8 +49,8 @@ beastpatcher-ppc: beastpatcher.c bootimg.c usb.h main.c libusb-ppc.a | |||
49 | $(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 | 49 | $(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 |
50 | strip beastpatcher-ppc | 50 | strip beastpatcher-ppc |
51 | 51 | ||
52 | bin2c: ../../../rbutil/sansapatcher/bin2c.c | 52 | bin2c: ../../../rbutil/tools/bin2c.c |
53 | $(NATIVECC) $(CFLAGS) -o bin2c ../../../rbutil/sansapatcher/bin2c.c | 53 | $(NATIVECC) $(CFLAGS) -o bin2c ../../../rbutil/tools/bin2c.c |
54 | 54 | ||
55 | bootimg.c: bootloader.bin bin2c | 55 | bootimg.c: bootloader.bin bin2c |
56 | ./bin2c bootloader.bin bootimg | 56 | ./bin2c bootloader.bin bootimg |