diff options
| author | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2009-06-13 14:15:50 +0000 |
|---|---|---|
| committer | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2009-06-13 14:15:50 +0000 |
| commit | 73f9bde9088f0bc447725fdb512a78034060dc9d (patch) | |
| tree | 7042f51c35bbac42cb1c5ecb9698ba750545c0b3 | |
| parent | 1c83e6ab900706a4d5d7dad631cae2305fa39f11 (diff) | |
| download | rockbox-73f9bde9088f0bc447725fdb512a78034060dc9d.zip rockbox-73f9bde9088f0bc447725fdb512a78034060dc9d.tar.gz rockbox-73f9bde9088f0bc447725fdb512a78034060dc9d.tar.bz2 rockbox-73f9bde9088f0bc447725fdb512a78034060dc9d.tar.xz | |
Make bin2c compile with VS2005 and move it to a separate folder as its getting used by different tools now.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21272 a1c6a512-1295-4272-9138-f99709370657
| -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 9c5bec1..98d3971 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 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 strip sansapatcher-ppc -bin2c: bin2c.c - $(NATIVECC) $(CFLAGS) -o bin2c bin2c.c +bootimg_c200.c: firmware.mi4 ../tools/bin2c + ../tools/bin2c firmware.mi4 bootimg_c200 -bootimg_c200.c: firmware.mi4 bin2c - ./bin2c firmware.mi4 bootimg_c200 - -bootimg_e200.c: PP5022.mi4 bin2c - ./bin2c PP5022.mi4 bootimg_e200 +bootimg_e200.c: PP5022.mi4 ../tools/bin2c + ../tools/bin2c PP5022.mi4 bootimg_e200 clean: - rm -f sansapatcher.exe sansapatcher-mac sansapatcher-i386 sansapatcher-ppc sansapatcher bin2c bootimg_c200.c bootimg_c200.h bootimg_e200.c bootimg_e200.h *~ + 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 0000000..baafdf8 --- /dev/null +++ b/rbutil/tools/Makefile @@ -0,0 +1,25 @@ +CFLAGS=-Wall -W -D_LARGEFILE64_SOURCE
+
+ifeq ($(findstring CYGWIN,$(shell uname)),CYGWIN)
+CROSS=
+CFLAGS+=-mno-cygwin
+else
+ifeq ($(findstring MINGW,$(shell uname)),MINGW)
+CROSS=
+else
+CROSS=i586-mingw32msvc-
+endif
+endif
+
+NATIVECC = gcc
+CC = $(CROSS)gcc
+WINDRES = $(CROSS)windres
+
+
+all: bin2c
+
+bin2c: bin2c.c
+ $(NATIVECC) $(CFLAGS) -o bin2c bin2c.c
+
+clean:
+ $(RM) bin2c bin2c.exe
diff --git a/rbutil/sansapatcher/bin2c.c b/rbutil/tools/bin2c.c index 7b06069..75b44d5 100644 --- a/rbutil/sansapatcher/bin2c.c +++ b/rbutil/tools/bin2c.c @@ -23,9 +23,17 @@ #include <string.h> #include <sys/types.h> #include <sys/stat.h> -#include <unistd.h> #include <fcntl.h> #include <stdlib.h> +#if !defined(_MSC_VER) +#include <unistd.h> +#else +#include <io.h> +#define snprintf _snprintf +#define open _open +#define close _close +#define read _read +#endif #ifndef O_BINARY #define O_BINARY 0 diff --git a/utils/MTP/beastpatcher/Makefile b/utils/MTP/beastpatcher/Makefile index 5f3951d..590473a 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 $(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 strip beastpatcher-ppc -bin2c: ../../../rbutil/sansapatcher/bin2c.c - $(NATIVECC) $(CFLAGS) -o bin2c ../../../rbutil/sansapatcher/bin2c.c +bin2c: ../../../rbutil/tools/bin2c.c + $(NATIVECC) $(CFLAGS) -o bin2c ../../../rbutil/tools/bin2c.c bootimg.c: bootloader.bin bin2c ./bin2c bootloader.bin bootimg |