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
|
|
|
|
gcc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -o bin/i386/program -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
|
|
|
|
gcc -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
|
|
|
|
|
2007-03-15 23:26:47 +00:00
|
|
|
bin2c: bin2c.c
|
|
|
|
$(NATIVECC) $(CFLAGS) -o bin2c bin2c.c
|
2007-03-15 22:55:36 +00:00
|
|
|
|
2007-09-19 18:46:54 +00:00
|
|
|
bootimg_c200.c: firmware.mi4 bin2c
|
|
|
|
./bin2c firmware.mi4 bootimg_c200
|
|
|
|
|
|
|
|
bootimg_e200.c: PP5022.mi4 bin2c
|
|
|
|
./bin2c PP5022.mi4 bootimg_e200
|
2007-03-15 22:55:36 +00:00
|
|
|
|
|
|
|
clean:
|
2007-09-19 18:46:54 +00:00
|
|
|
rm -f sansapatcher.exe sansapatcher-mac sansapatcher-i386 sansapatcher-ppc sansapatcher bin2c bootimg_c200.c bootimg_c200.h bootimg_e200.c bootimg_e200.h *~
|