2007-07-29 21:19:14 +00:00
|
|
|
CFLAGS=-Wall -W
|
2007-02-05 00:50:49 +00:00
|
|
|
|
2009-12-09 13:13:58 +00:00
|
|
|
BOOT_H = ipod1g2g.h ipod3g.h ipod4g.h ipodcolor.h ipodmini1g.h ipodmini2g.h ipodnano1g.h ipodvideo.h
|
2007-02-08 18:05:50 +00:00
|
|
|
|
2010-01-28 09:20:32 +00:00
|
|
|
# Build with "make BOOTOBJS=1" to build with embedded bootloaders and the
|
2007-02-08 18:05:50 +00:00
|
|
|
# --install option and interactive mode. You need the full set of Rockbox
|
|
|
|
# bootloaders in this directory - download them from
|
|
|
|
# http://download.rockbox.org/bootloader/ipod/bootloaders.zip
|
|
|
|
|
2010-01-28 09:20:32 +00:00
|
|
|
# Releases of ipodpatcher are created with "make RELEASE=1". This
|
|
|
|
# enables BOOTOBJS and uses the VERSION string defined in main.c
|
|
|
|
|
2011-09-26 20:00:26 +00:00
|
|
|
ifndef V
|
|
|
|
SILENT = @
|
|
|
|
endif
|
|
|
|
|
2009-10-13 08:02:59 +00:00
|
|
|
ifdef RELEASE
|
|
|
|
CFLAGS+=-DRELEASE
|
|
|
|
BOOTOBJS=1
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef BOOTOBJS
|
2009-12-09 13:13:58 +00:00
|
|
|
BOOTSRC = ipod1g2g.c ipod3g.c ipod4g.c ipodcolor.c ipodmini1g.c ipodmini2g.c ipodnano1g.c ipodvideo.c ipodnano2g.c
|
2009-10-13 08:02:59 +00:00
|
|
|
CFLAGS += -DWITH_BOOTOBJS
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifndef VERSION
|
|
|
|
VERSION=$(shell ../../tools/version.sh)
|
|
|
|
endif
|
|
|
|
|
|
|
|
CFLAGS+=-DVERSION=\"$(VERSION)\"
|
2007-02-08 18:05:50 +00:00
|
|
|
|
2007-02-05 00:50:49 +00:00
|
|
|
ifeq ($(findstring CYGWIN,$(shell uname)),CYGWIN)
|
|
|
|
OUTPUT=ipodpatcher.exe
|
|
|
|
CROSS=
|
|
|
|
CFLAGS+=-mno-cygwin
|
2008-01-06 11:55:55 +00:00
|
|
|
else
|
|
|
|
ifeq ($(findstring MINGW,$(shell uname)),MINGW)
|
|
|
|
OUTPUT=ipodpatcher.exe
|
|
|
|
CROSS=
|
2007-02-05 00:50:49 +00:00
|
|
|
else
|
|
|
|
OUTPUT=ipodpatcher
|
|
|
|
CROSS=i586-mingw32msvc-
|
|
|
|
endif
|
2008-01-06 11:55:55 +00:00
|
|
|
endif
|
2010-01-30 17:02:37 +00:00
|
|
|
ifeq ($(findstring Darwin,$(shell uname)),Darwin)
|
|
|
|
# building against SDK 10.4 is not compatible with gcc-4.2 (default on newer Xcode)
|
|
|
|
# might need adjustment for older Xcode.
|
|
|
|
NATIVECC ?= gcc-4.0
|
|
|
|
CFLAGS+=-framework CoreFoundation -framework IOKit -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4
|
|
|
|
endif
|
2007-02-05 00:50:49 +00:00
|
|
|
|
2010-01-30 17:02:37 +00:00
|
|
|
NATIVECC ?= gcc
|
2007-02-08 18:05:50 +00:00
|
|
|
CC = $(CROSS)gcc
|
2007-09-21 06:24:17 +00:00
|
|
|
WINDRES = $(CROSS)windres
|
2007-02-08 18:05:50 +00:00
|
|
|
|
2008-08-30 09:49:00 +00:00
|
|
|
SRC = main.c ipodpatcher.c fat32format.c arc4.c
|
2007-06-16 22:32:57 +00:00
|
|
|
|
2007-02-05 00:50:49 +00:00
|
|
|
all: $(OUTPUT)
|
2006-12-13 08:57:06 +00:00
|
|
|
|
2007-06-16 22:32:57 +00:00
|
|
|
ipodpatcher: $(SRC) ipodio-posix.c $(BOOTSRC)
|
2010-01-30 17:02:37 +00:00
|
|
|
$(NATIVECC) $(CFLAGS) -o ipodpatcher $(SRC) ipodio-posix.c $(BOOTSRC)
|
2007-02-05 00:50:49 +00:00
|
|
|
strip ipodpatcher
|
2006-12-13 09:02:18 +00:00
|
|
|
|
2009-08-04 20:32:30 +00:00
|
|
|
ipodpatcher.exe: $(SRC) ipodio-win32.c ipodio-win32-scsi.c ipodpatcher-rc.o $(BOOTSRC)
|
|
|
|
$(CC) $(CFLAGS) -o ipodpatcher.exe $(SRC) ipodio-win32.c ipodio-win32-scsi.c ipodpatcher-rc.o $(BOOTSRC)
|
2007-02-05 00:50:49 +00:00
|
|
|
$(CROSS)strip ipodpatcher.exe
|
2006-12-13 08:57:06 +00:00
|
|
|
|
2007-09-21 06:24:17 +00:00
|
|
|
ipodpatcher-rc.o: ipodpatcher.rc ipodpatcher.manifest
|
|
|
|
$(WINDRES) -i ipodpatcher.rc -o ipodpatcher-rc.o
|
|
|
|
|
2007-03-03 10:57:32 +00:00
|
|
|
ipodpatcher-mac: ipodpatcher-i386 ipodpatcher-ppc
|
|
|
|
lipo -create ipodpatcher-ppc ipodpatcher-i386 -output ipodpatcher-mac
|
|
|
|
|
2007-06-16 22:32:57 +00:00
|
|
|
ipodpatcher-i386: $(SRC) ipodio-posix.c $(BOOTSRC)
|
2010-01-30 17:02:37 +00:00
|
|
|
$(NATIVECC) -arch i386 $(CFLAGS) -o ipodpatcher-i386 $(SRC) ipodio-posix.c $(BOOTSRC)
|
2007-03-03 10:57:32 +00:00
|
|
|
strip ipodpatcher-i386
|
|
|
|
|
2007-06-16 22:32:57 +00:00
|
|
|
ipodpatcher-ppc: $(SRC) ipodio-posix.c $(BOOTSRC)
|
2010-01-30 17:02:37 +00:00
|
|
|
$(NATIVECC) -arch ppc $(CFLAGS) -o ipodpatcher-ppc $(SRC) ipodio-posix.c $(BOOTSRC)
|
2007-03-03 10:57:32 +00:00
|
|
|
strip ipodpatcher-ppc
|
|
|
|
|
2007-02-08 18:05:50 +00:00
|
|
|
ipod2c: ipod2c.c
|
|
|
|
$(NATIVECC) $(CFLAGS) -o ipod2c ipod2c.c
|
|
|
|
|
2011-09-26 20:00:26 +00:00
|
|
|
%.c: bootloader-%.ipod ipod2c
|
|
|
|
@echo IPOD2C $<
|
|
|
|
$(SILENT)./ipod2c $< $*
|
2009-10-13 08:02:59 +00:00
|
|
|
|
2011-09-26 20:00:26 +00:00
|
|
|
%.c: bootloader-%.ipodx ipod2c
|
|
|
|
@echo IPOD2C $<
|
|
|
|
$(SILENT)./ipod2c $< $*
|
2007-02-08 18:05:50 +00:00
|
|
|
|
2006-12-13 08:57:06 +00:00
|
|
|
clean:
|
2007-09-21 06:52:45 +00:00
|
|
|
rm -f ipodpatcher.exe ipodpatcher-rc.o ipodpatcher-mac ipodpatcher-i386 ipodpatcher-ppc ipodpatcher ipod2c *~ $(BOOTSRC) $(BOOT_H)
|