Correct beast manual install instructions in Windows.
[kugel-rb.git] / rbutil / ipodpatcher / Makefile
blob713c21b546c6596a3345ed2a5f4c8fa45464f1e9
1 CFLAGS=-Wall -W
3 BOOT_H = ipod1g2g.h ipod3g.h ipod4g.h ipodcolor.h ipodmini.h ipodmini2g.h ipodnano.h ipodvideo.h
5 # Enable the next two lines to build with embedded bootloaders and the
6 # --install option and interactive mode. You need the full set of Rockbox
7 # bootloaders in this directory - download them from
8 # http://download.rockbox.org/bootloader/ipod/bootloaders.zip
10 ifdef RELEASE
11 CFLAGS+=-DRELEASE
12 BOOTOBJS=1
13 endif
15 ifdef BOOTOBJS
16 BOOTSRC = ipod1g2g.c ipod3g.c ipod4g.c ipodcolor.c ipodmini.c ipodmini2g.c ipodnano.c ipodvideo.c ipodnano2g.c
17 CFLAGS += -DWITH_BOOTOBJS
18 endif
20 ifndef VERSION
21 VERSION=$(shell ../../tools/version.sh)
22 endif
24 CFLAGS+=-DVERSION=\"$(VERSION)\"
26 ifeq ($(findstring CYGWIN,$(shell uname)),CYGWIN)
27 OUTPUT=ipodpatcher.exe
28 CROSS=
29 CFLAGS+=-mno-cygwin
30 else
31 ifeq ($(findstring MINGW,$(shell uname)),MINGW)
32 OUTPUT=ipodpatcher.exe
33 CROSS=
34 else
35 OUTPUT=ipodpatcher
36 CROSS=i586-mingw32msvc-
37 endif
38 endif
40 NATIVECC = gcc
41 CC = $(CROSS)gcc
42 WINDRES = $(CROSS)windres
44 SRC = main.c ipodpatcher.c fat32format.c arc4.c
46 all: $(OUTPUT)
48 ipodpatcher: $(SRC) ipodio-posix.c $(BOOTSRC)
49 gcc $(CFLAGS) -o ipodpatcher $(SRC) ipodio-posix.c $(BOOTSRC)
50 strip ipodpatcher
52 ipodpatcher.exe: $(SRC) ipodio-win32.c ipodio-win32-scsi.c ipodpatcher-rc.o $(BOOTSRC)
53 $(CC) $(CFLAGS) -o ipodpatcher.exe $(SRC) ipodio-win32.c ipodio-win32-scsi.c ipodpatcher-rc.o $(BOOTSRC)
54 $(CROSS)strip ipodpatcher.exe
56 ipodpatcher-rc.o: ipodpatcher.rc ipodpatcher.manifest
57 $(WINDRES) -i ipodpatcher.rc -o ipodpatcher-rc.o
59 ipodpatcher-mac: ipodpatcher-i386 ipodpatcher-ppc
60 lipo -create ipodpatcher-ppc ipodpatcher-i386 -output ipodpatcher-mac
62 ipodpatcher-i386: $(SRC) ipodio-posix.c $(BOOTSRC)
63 gcc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -arch i386 $(CFLAGS) -o ipodpatcher-i386 $(SRC) ipodio-posix.c $(BOOTSRC)
64 strip ipodpatcher-i386
66 ipodpatcher-ppc: $(SRC) ipodio-posix.c $(BOOTSRC)
67 gcc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -arch ppc $(CFLAGS) -o ipodpatcher-ppc $(SRC) ipodio-posix.c $(BOOTSRC)
68 strip ipodpatcher-ppc
70 ipod2c: ipod2c.c
71 $(NATIVECC) $(CFLAGS) -o ipod2c ipod2c.c
73 ipod1g2g.c: bootloader-ipod1g2g.ipod ipod2c
74 ./ipod2c bootloader-ipod1g2g.ipod ipod1g2g
76 ipod3g.c: bootloader-ipod3g.ipod ipod2c
77 ./ipod2c bootloader-ipod3g.ipod ipod3g
79 ipod4g.c: bootloader-ipod4g.ipod ipod2c
80 ./ipod2c bootloader-ipod4g.ipod ipod4g
82 ipodcolor.c: bootloader-ipodcolor.ipod ipod2c
83 ./ipod2c bootloader-ipodcolor.ipod ipodcolor
85 ipodmini.c: bootloader-ipodmini.ipod ipod2c
86 ./ipod2c bootloader-ipodmini.ipod ipodmini
88 ipodmini2g.c: bootloader-ipodmini2g.ipod ipod2c
89 ./ipod2c bootloader-ipodmini2g.ipod ipodmini2g
91 ipodnano.c: bootloader-ipodnano.ipod ipod2c
92 ./ipod2c bootloader-ipodnano.ipod ipodnano
94 ipodvideo.c: bootloader-ipodvideo.ipod ipod2c
95 ./ipod2c bootloader-ipodvideo.ipod ipodvideo
97 ipodnano2g.c: bootloader-ipodnano2g.ipodx ipod2c
98 ./ipod2c bootloader-ipodnano2g.ipodx ipodnano2g
101 clean:
102 rm -f ipodpatcher.exe ipodpatcher-rc.o ipodpatcher-mac ipodpatcher-i386 ipodpatcher-ppc ipodpatcher ipod2c *~ $(BOOTSRC) $(BOOT_H)