Dave Chapman | 2cc80f5 | 2007-07-29 21:19:14 +0000 | [diff] [blame] | 1 | CFLAGS=-Wall -W |
Jens Arnold | 7170a00 | 2007-02-05 00:50:49 +0000 | [diff] [blame] | 2 | |
Dave Chapman | 6a20def | 2007-07-26 20:21:11 +0000 | [diff] [blame] | 3 | BOOT_H = ipod1g2g.h ipod3g.h ipod4g.h ipodcolor.h ipodmini.h ipodmini2g.h ipodnano.h ipodvideo.h |
Dave Chapman | bdc27ff | 2007-02-08 18:05:50 +0000 | [diff] [blame] | 4 | |
| 5 | # Uncomment 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 |
| 9 | |
Dave Chapman | 6a20def | 2007-07-26 20:21:11 +0000 | [diff] [blame] | 10 | #BOOTSRC = ipod1g2g.c ipod3g.c ipod4g.c ipodcolor.c ipodmini.c ipodmini2g.c ipodnano.c ipodvideo.c |
Dave Chapman | c76dfb3 | 2007-02-08 18:22:23 +0000 | [diff] [blame] | 11 | #CFLAGS += -DWITH_BOOTOBJS |
Dave Chapman | bdc27ff | 2007-02-08 18:05:50 +0000 | [diff] [blame] | 12 | |
Jens Arnold | 7170a00 | 2007-02-05 00:50:49 +0000 | [diff] [blame] | 13 | ifeq ($(findstring CYGWIN,$(shell uname)),CYGWIN) |
| 14 | OUTPUT=ipodpatcher.exe |
| 15 | CROSS= |
| 16 | CFLAGS+=-mno-cygwin |
| 17 | else |
| 18 | OUTPUT=ipodpatcher |
| 19 | CROSS=i586-mingw32msvc- |
| 20 | endif |
| 21 | |
Dave Chapman | bdc27ff | 2007-02-08 18:05:50 +0000 | [diff] [blame] | 22 | NATIVECC = gcc |
| 23 | CC = $(CROSS)gcc |
Jens Arnold | 4ce9368 | 2007-09-21 06:24:17 +0000 | [diff] [blame] | 24 | WINDRES = $(CROSS)windres |
Dave Chapman | bdc27ff | 2007-02-08 18:05:50 +0000 | [diff] [blame] | 25 | |
Dave Chapman | 6e79715 | 2007-09-08 23:27:49 +0000 | [diff] [blame] | 26 | SRC = main.c ipodpatcher.c fat32format.c parttypes.h arc4.c |
Dave Chapman | 56780e3 | 2007-06-16 22:32:57 +0000 | [diff] [blame] | 27 | |
Jens Arnold | 7170a00 | 2007-02-05 00:50:49 +0000 | [diff] [blame] | 28 | all: $(OUTPUT) |
Dave Chapman | 45895df | 2006-12-13 08:57:06 +0000 | [diff] [blame] | 29 | |
Dave Chapman | 56780e3 | 2007-06-16 22:32:57 +0000 | [diff] [blame] | 30 | ipodpatcher: $(SRC) ipodio-posix.c $(BOOTSRC) |
| 31 | gcc $(CFLAGS) -o ipodpatcher $(SRC) ipodio-posix.c $(BOOTSRC) |
Jens Arnold | 7170a00 | 2007-02-05 00:50:49 +0000 | [diff] [blame] | 32 | strip ipodpatcher |
Dave Chapman | 4b7e1e0 | 2006-12-13 09:02:18 +0000 | [diff] [blame] | 33 | |
Jens Arnold | 4ce9368 | 2007-09-21 06:24:17 +0000 | [diff] [blame] | 34 | ipodpatcher.exe: $(SRC) ipodio-win32.c ipodpatcher-rc.o $(BOOTSRC) |
| 35 | $(CC) $(CFLAGS) -o ipodpatcher.exe $(SRC) ipodio-win32.c ipodpatcher-rc.o $(BOOTSRC) |
Jens Arnold | 7170a00 | 2007-02-05 00:50:49 +0000 | [diff] [blame] | 36 | $(CROSS)strip ipodpatcher.exe |
Dave Chapman | 45895df | 2006-12-13 08:57:06 +0000 | [diff] [blame] | 37 | |
Jens Arnold | 4ce9368 | 2007-09-21 06:24:17 +0000 | [diff] [blame] | 38 | ipodpatcher-rc.o: ipodpatcher.rc ipodpatcher.manifest |
| 39 | $(WINDRES) -i ipodpatcher.rc -o ipodpatcher-rc.o |
| 40 | |
Dave Chapman | 1602bf5 | 2007-03-03 10:57:32 +0000 | [diff] [blame] | 41 | ipodpatcher-mac: ipodpatcher-i386 ipodpatcher-ppc |
| 42 | lipo -create ipodpatcher-ppc ipodpatcher-i386 -output ipodpatcher-mac |
| 43 | |
Dave Chapman | 56780e3 | 2007-06-16 22:32:57 +0000 | [diff] [blame] | 44 | ipodpatcher-i386: $(SRC) ipodio-posix.c $(BOOTSRC) |
| 45 | gcc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -o bin/i386/program -arch i386 $(CFLAGS) -o ipodpatcher-i386 $(SRC) ipodio-posix.c $(BOOTSRC) |
Dave Chapman | 1602bf5 | 2007-03-03 10:57:32 +0000 | [diff] [blame] | 46 | strip ipodpatcher-i386 |
| 47 | |
Dave Chapman | 56780e3 | 2007-06-16 22:32:57 +0000 | [diff] [blame] | 48 | ipodpatcher-ppc: $(SRC) ipodio-posix.c $(BOOTSRC) |
| 49 | gcc -arch ppc $(CFLAGS) -o ipodpatcher-ppc $(SRC) ipodio-posix.c $(BOOTSRC) |
Dave Chapman | 1602bf5 | 2007-03-03 10:57:32 +0000 | [diff] [blame] | 50 | strip ipodpatcher-ppc |
| 51 | |
Dave Chapman | bdc27ff | 2007-02-08 18:05:50 +0000 | [diff] [blame] | 52 | ipod2c: ipod2c.c |
| 53 | $(NATIVECC) $(CFLAGS) -o ipod2c ipod2c.c |
| 54 | |
Dave Chapman | 6a20def | 2007-07-26 20:21:11 +0000 | [diff] [blame] | 55 | ipod1g2g.c: bootloader-ipod1g2g.ipod ipod2c |
| 56 | ./ipod2c bootloader-ipod1g2g.ipod ipod1g2g |
| 57 | |
Dave Chapman | bdc27ff | 2007-02-08 18:05:50 +0000 | [diff] [blame] | 58 | ipod3g.c: bootloader-ipod3g.ipod ipod2c |
| 59 | ./ipod2c bootloader-ipod3g.ipod ipod3g |
| 60 | |
| 61 | ipod4g.c: bootloader-ipod4g.ipod ipod2c |
| 62 | ./ipod2c bootloader-ipod4g.ipod ipod4g |
| 63 | |
| 64 | ipodcolor.c: bootloader-ipodcolor.ipod ipod2c |
| 65 | ./ipod2c bootloader-ipodcolor.ipod ipodcolor |
| 66 | |
| 67 | ipodmini.c: bootloader-ipodmini.ipod ipod2c |
| 68 | ./ipod2c bootloader-ipodmini.ipod ipodmini |
| 69 | |
| 70 | ipodmini2g.c: bootloader-ipodmini2g.ipod ipod2c |
| 71 | ./ipod2c bootloader-ipodmini2g.ipod ipodmini2g |
| 72 | |
| 73 | ipodnano.c: bootloader-ipodnano.ipod ipod2c |
| 74 | ./ipod2c bootloader-ipodnano.ipod ipodnano |
| 75 | |
| 76 | ipodvideo.c: bootloader-ipodvideo.ipod ipod2c |
| 77 | ./ipod2c bootloader-ipodvideo.ipod ipodvideo |
| 78 | |
| 79 | |
Dave Chapman | 45895df | 2006-12-13 08:57:06 +0000 | [diff] [blame] | 80 | clean: |
Jens Arnold | 2a61259 | 2007-09-21 06:52:45 +0000 | [diff] [blame] | 81 | rm -f ipodpatcher.exe ipodpatcher-rc.o ipodpatcher-mac ipodpatcher-i386 ipodpatcher-ppc ipodpatcher ipod2c *~ $(BOOTSRC) $(BOOT_H) |