blob: 4254995d22784d9103763dfaa433bf3249f2a20f [file] [log] [blame]
Dominik Riebelingb056e022011-12-16 18:35:01 +00001# __________ __ ___.
2# Open \______ \ ____ ____ | | _\_ |__ _______ ___
3# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6# \/ \/ \/ \/ \/
7# $Id$
8#
Jens Arnold7170a002007-02-05 00:50:49 +00009
Rafaël Carrédb3afb02012-02-05 14:03:10 -050010CFLAGS += -Wall -W
Dave Chapmanbdc27ff2007-02-08 18:05:50 +000011
Dave Chapman4cb879d2010-01-28 09:20:32 +000012# Build with "make BOOTOBJS=1" to build with embedded bootloaders and the
Dave Chapmanbdc27ff2007-02-08 18:05:50 +000013# --install option and interactive mode. You need the full set of Rockbox
14# bootloaders in this directory - download them from
15# http://download.rockbox.org/bootloader/ipod/bootloaders.zip
16
Dave Chapman4cb879d2010-01-28 09:20:32 +000017# Releases of ipodpatcher are created with "make RELEASE=1". This
18# enables BOOTOBJS and uses the VERSION string defined in main.c
Dave Chapman8e95cc42009-10-13 08:02:59 +000019ifdef RELEASE
Dominik Riebelingb056e022011-12-16 18:35:01 +000020CFLAGS += -DRELEASE
Dave Chapman8e95cc42009-10-13 08:02:59 +000021BOOTOBJS=1
22endif
23
24ifdef BOOTOBJS
Dominik Riebelingb056e022011-12-16 18:35:01 +000025BOOTSRC = ipod1g2g.c ipod3g.c ipod4g.c ipodcolor.c ipodmini1g.c \
26 ipodmini2g.c ipodnano1g.c ipodvideo.c ipodnano2g.c
Dave Chapman8e95cc42009-10-13 08:02:59 +000027CFLAGS += -DWITH_BOOTOBJS
28endif
29
Dominik Riebelingb056e022011-12-16 18:35:01 +000030# additional frameworks to link on on OS X
Dominik Riebeling703bc402013-04-05 20:03:45 +020031LDOPTS_OSX = -framework CoreFoundation -framework IOKit
Jens Arnold7170a002007-02-05 00:50:49 +000032
Dominik Riebelingb056e022011-12-16 18:35:01 +000033LIBSOURCES = ipodpatcher.c fat32format.c arc4.c \
34 ipodio-posix.c ipodio-win32-scsi.c ipodio-win32.c
Dominik Riebeling6f4beaa2016-12-16 19:39:07 +010035SOURCES = main.c $(BOOTSRC)
Dominik Riebelingb056e022011-12-16 18:35:01 +000036ipodpatcher: SOURCES+= ipodio-posix.c
Dave Chapmanbdc27ff2007-02-08 18:05:50 +000037
Dominik Riebelingb056e022011-12-16 18:35:01 +000038OUTPUT = ipodpatcher
Dominik Riebelingb056e022011-12-16 18:35:01 +000039include ../libtools.make
Dave Chapman45895df2006-12-13 08:57:06 +000040
Dominik Riebelingb3ef8c82013-04-01 21:30:26 +020041ipodpatcher.exe: $(OBJDIR)ipodpatcher-rc.o
Dominik Riebelingb056e022011-12-16 18:35:01 +000042$(OBJDIR)ipodpatcher-rc.o: ipodpatcher.rc ipodpatcher.manifest
Dominik Riebelingb3ef8c82013-04-01 21:30:26 +020043 @echo WINDRES $(notdir $<)
44 $(SILENT)$(CROSS)$(WINDRES) -i $< -o $@
Dave Chapman1602bf52007-03-03 10:57:32 +000045
Dominik Riebeling8a3824f2012-04-28 12:06:55 +020046%.c: bootloader-%.ipod $(BIN2C)
47 @echo BIN2C $<
48 $(SILENT)$(BIN2C) -i $< $*
Dave Chapmanbdc27ff2007-02-08 18:05:50 +000049
Dominik Riebeling8a3824f2012-04-28 12:06:55 +020050%.c: bootloader-%.ipodx $(BIN2C)
51 @echo BIN2C $<
52 $(SILENT)$(BIN2C) -i $< $*
Dave Chapmanbdc27ff2007-02-08 18:05:50 +000053