blob: 79d1b2f62a30b34172e0e7bf64e89ba0d9d5baba [file] [log] [blame]
Dave Chapman2cc80f52007-07-29 21:19:14 +00001CFLAGS=-Wall -W
Jens Arnold7170a002007-02-05 00:50:49 +00002
Dave Chapman6a20def2007-07-26 20:21:11 +00003BOOT_H = ipod1g2g.h ipod3g.h ipod4g.h ipodcolor.h ipodmini.h ipodmini2g.h ipodnano.h ipodvideo.h
Dave Chapmanbdc27ff2007-02-08 18:05:50 +00004
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 Chapman6a20def2007-07-26 20:21:11 +000010#BOOTSRC = ipod1g2g.c ipod3g.c ipod4g.c ipodcolor.c ipodmini.c ipodmini2g.c ipodnano.c ipodvideo.c
Dave Chapmanc76dfb32007-02-08 18:22:23 +000011#CFLAGS += -DWITH_BOOTOBJS
Dave Chapmanbdc27ff2007-02-08 18:05:50 +000012
Jens Arnold7170a002007-02-05 00:50:49 +000013ifeq ($(findstring CYGWIN,$(shell uname)),CYGWIN)
14OUTPUT=ipodpatcher.exe
15CROSS=
16CFLAGS+=-mno-cygwin
17else
18OUTPUT=ipodpatcher
19CROSS=i586-mingw32msvc-
20endif
21
Dave Chapmanbdc27ff2007-02-08 18:05:50 +000022NATIVECC = gcc
23CC = $(CROSS)gcc
Jens Arnold4ce93682007-09-21 06:24:17 +000024WINDRES = $(CROSS)windres
Dave Chapmanbdc27ff2007-02-08 18:05:50 +000025
Dave Chapman6e797152007-09-08 23:27:49 +000026SRC = main.c ipodpatcher.c fat32format.c parttypes.h arc4.c
Dave Chapman56780e32007-06-16 22:32:57 +000027
Jens Arnold7170a002007-02-05 00:50:49 +000028all: $(OUTPUT)
Dave Chapman45895df2006-12-13 08:57:06 +000029
Dave Chapman56780e32007-06-16 22:32:57 +000030ipodpatcher: $(SRC) ipodio-posix.c $(BOOTSRC)
31 gcc $(CFLAGS) -o ipodpatcher $(SRC) ipodio-posix.c $(BOOTSRC)
Jens Arnold7170a002007-02-05 00:50:49 +000032 strip ipodpatcher
Dave Chapman4b7e1e02006-12-13 09:02:18 +000033
Jens Arnold4ce93682007-09-21 06:24:17 +000034ipodpatcher.exe: $(SRC) ipodio-win32.c ipodpatcher-rc.o $(BOOTSRC)
35 $(CC) $(CFLAGS) -o ipodpatcher.exe $(SRC) ipodio-win32.c ipodpatcher-rc.o $(BOOTSRC)
Jens Arnold7170a002007-02-05 00:50:49 +000036 $(CROSS)strip ipodpatcher.exe
Dave Chapman45895df2006-12-13 08:57:06 +000037
Jens Arnold4ce93682007-09-21 06:24:17 +000038ipodpatcher-rc.o: ipodpatcher.rc ipodpatcher.manifest
39 $(WINDRES) -i ipodpatcher.rc -o ipodpatcher-rc.o
40
Dave Chapman1602bf52007-03-03 10:57:32 +000041ipodpatcher-mac: ipodpatcher-i386 ipodpatcher-ppc
42 lipo -create ipodpatcher-ppc ipodpatcher-i386 -output ipodpatcher-mac
43
Dave Chapman56780e32007-06-16 22:32:57 +000044ipodpatcher-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 Chapman1602bf52007-03-03 10:57:32 +000046 strip ipodpatcher-i386
47
Dave Chapman56780e32007-06-16 22:32:57 +000048ipodpatcher-ppc: $(SRC) ipodio-posix.c $(BOOTSRC)
49 gcc -arch ppc $(CFLAGS) -o ipodpatcher-ppc $(SRC) ipodio-posix.c $(BOOTSRC)
Dave Chapman1602bf52007-03-03 10:57:32 +000050 strip ipodpatcher-ppc
51
Dave Chapmanbdc27ff2007-02-08 18:05:50 +000052ipod2c: ipod2c.c
53 $(NATIVECC) $(CFLAGS) -o ipod2c ipod2c.c
54
Dave Chapman6a20def2007-07-26 20:21:11 +000055ipod1g2g.c: bootloader-ipod1g2g.ipod ipod2c
56 ./ipod2c bootloader-ipod1g2g.ipod ipod1g2g
57
Dave Chapmanbdc27ff2007-02-08 18:05:50 +000058ipod3g.c: bootloader-ipod3g.ipod ipod2c
59 ./ipod2c bootloader-ipod3g.ipod ipod3g
60
61ipod4g.c: bootloader-ipod4g.ipod ipod2c
62 ./ipod2c bootloader-ipod4g.ipod ipod4g
63
64ipodcolor.c: bootloader-ipodcolor.ipod ipod2c
65 ./ipod2c bootloader-ipodcolor.ipod ipodcolor
66
67ipodmini.c: bootloader-ipodmini.ipod ipod2c
68 ./ipod2c bootloader-ipodmini.ipod ipodmini
69
70ipodmini2g.c: bootloader-ipodmini2g.ipod ipod2c
71 ./ipod2c bootloader-ipodmini2g.ipod ipodmini2g
72
73ipodnano.c: bootloader-ipodnano.ipod ipod2c
74 ./ipod2c bootloader-ipodnano.ipod ipodnano
75
76ipodvideo.c: bootloader-ipodvideo.ipod ipod2c
77 ./ipod2c bootloader-ipodvideo.ipod ipodvideo
78
79
Dave Chapman45895df2006-12-13 08:57:06 +000080clean:
Jens Arnold2a612592007-09-21 06:52:45 +000081 rm -f ipodpatcher.exe ipodpatcher-rc.o ipodpatcher-mac ipodpatcher-i386 ipodpatcher-ppc ipodpatcher ipod2c *~ $(BOOTSRC) $(BOOT_H)