2007-07-29 21:47:05 +00:00
|
|
|
CFLAGS=-Wall -W -D_LARGEFILE64_SOURCE
|
2007-03-15 22:55:36 +00:00
|
|
|
|
|
|
|
ifeq ($(findstring CYGWIN,$(shell uname)),CYGWIN)
|
|
|
|
OUTPUT=sansapatcher.exe
|
|
|
|
CROSS=
|
|
|
|
CFLAGS+=-mno-cygwin
|
|
|
|
else
|
2008-01-06 11:55:55 +00:00
|
|
|
ifeq ($(findstring MINGW,$(shell uname)),MINGW)
|
|
|
|
OUTPUT=sansapatcher.exe
|
2008-01-26 22:19:27 +00:00
|
|
|
CROSS=
|
2008-01-06 11:55:55 +00:00
|
|
|
else
|
2007-03-15 22:55:36 +00:00
|
|
|
OUTPUT=sansapatcher
|
|
|
|
CROSS=i586-mingw32msvc-
|
|
|
|
endif
|
2008-01-06 11:55:55 +00:00
|
|
|
endif
|
2007-03-15 22:55:36 +00:00
|
|
|
|
|
|
|
NATIVECC = gcc
|
|
|
|
CC = $(CROSS)gcc
|
2008-01-20 21:19:37 +00:00
|
|
|
WINDRES = $(CROSS)windres
|
2007-03-15 22:55:36 +00:00
|
|
|
|
|
|
|
all: $(OUTPUT)
|
|
|
|
|
2007-09-19 18:46:54 +00:00
|
|
|
sansapatcher: main.c sansapatcher.c sansaio-posix.c parttypes.h bootimg_c200.c bootimg_e200.c
|
|
|
|
gcc $(CFLAGS) -o sansapatcher main.c sansapatcher.c sansaio-posix.c bootimg_c200.c bootimg_e200.c
|
2007-03-15 22:55:36 +00:00
|
|
|
strip sansapatcher
|
|
|
|
|
2008-01-20 21:19:37 +00:00
|
|
|
sansapatcher.exe: main.c sansapatcher.c sansaio-win32.c parttypes.h bootimg_c200.c bootimg_e200.c sansapatcher-rc.o
|
|
|
|
$(CC) $(CFLAGS) -o sansapatcher.exe main.c sansapatcher.c sansaio-win32.c bootimg_c200.c bootimg_e200.c sansapatcher-rc.o
|
2007-03-15 22:55:36 +00:00
|
|
|
$(CROSS)strip sansapatcher.exe
|
|
|
|
|
2008-01-20 21:19:37 +00:00
|
|
|
sansapatcher-rc.o: sansapatcher.rc sansapatcher.manifest
|
|
|
|
$(WINDRES) -i sansapatcher.rc -o sansapatcher-rc.o
|
|
|
|
|
2007-03-15 22:55:36 +00:00
|
|
|
sansapatcher-mac: sansapatcher-i386 sansapatcher-ppc
|
|
|
|
lipo -create sansapatcher-ppc sansapatcher-i386 -output sansapatcher-mac
|
|
|
|
|
2007-09-19 18:46:54 +00:00
|
|
|
sansapatcher-i386: main.c sansapatcher.c sansaio-posix.c parttypes.h bootimg_c200.c bootimg_e200.c
|
2008-03-25 19:50:41 +00:00
|
|
|
gcc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -arch i386 $(CFLAGS) -o sansapatcher-i386 main.c sansapatcher.c sansaio-posix.c bootimg_c200.c bootimg_e200.c
|
2007-03-15 22:55:36 +00:00
|
|
|
strip sansapatcher-i386
|
|
|
|
|
2007-09-19 18:46:54 +00:00
|
|
|
sansapatcher-ppc: main.c sansapatcher.c sansaio-posix.c parttypes.h bootimg_c200.c bootimg_e200.c
|
2008-03-25 19:50:41 +00:00
|
|
|
gcc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -arch ppc $(CFLAGS) -o sansapatcher-ppc main.c sansapatcher.c sansaio-posix.c bootimg_c200.c bootimg_e200.c
|
2007-03-15 22:55:36 +00:00
|
|
|
strip sansapatcher-ppc
|
|
|
|
|
2009-06-13 14:15:50 +00:00
|
|
|
bootimg_c200.c: firmware.mi4 ../tools/bin2c
|
|
|
|
../tools/bin2c firmware.mi4 bootimg_c200
|
2007-03-15 22:55:36 +00:00
|
|
|
|
2009-06-13 14:15:50 +00:00
|
|
|
bootimg_e200.c: PP5022.mi4 ../tools/bin2c
|
|
|
|
../tools/bin2c PP5022.mi4 bootimg_e200
|
2007-03-15 22:55:36 +00:00
|
|
|
|
2009-06-22 23:06:56 +00:00
|
|
|
../tools/bin2c:
|
|
|
|
make -C ../tools bin2c
|
|
|
|
|
2007-03-15 22:55:36 +00:00
|
|
|
clean:
|
2009-06-13 14:15:50 +00:00
|
|
|
rm -f sansapatcher.exe sansapatcher-mac sansapatcher-i386 sansapatcher-ppc sansapatcher bootimg_c200.c bootimg_c200.h bootimg_e200.c bootimg_e200.h *~
|