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
|
|
|
|
OUTPUT=sansapatcher
|
|
|
|
CROSS=i586-mingw32msvc-
|
|
|
|
endif
|
|
|
|
|
|
|
|
NATIVECC = gcc
|
|
|
|
CC = $(CROSS)gcc
|
|
|
|
|
|
|
|
all: $(OUTPUT)
|
|
|
|
|
|
|
|
sansapatcher: main.c sansapatcher.c sansaio-posix.c parttypes.h bootimg.c
|
|
|
|
gcc $(CFLAGS) -o sansapatcher main.c sansapatcher.c sansaio-posix.c bootimg.c
|
|
|
|
strip sansapatcher
|
|
|
|
|
|
|
|
sansapatcher.exe: main.c sansapatcher.c sansaio-win32.c parttypes.h bootimg.c
|
|
|
|
$(CC) $(CFLAGS) -o sansapatcher.exe main.c sansapatcher.c sansaio-win32.c bootimg.c
|
|
|
|
$(CROSS)strip sansapatcher.exe
|
|
|
|
|
|
|
|
sansapatcher-mac: sansapatcher-i386 sansapatcher-ppc
|
|
|
|
lipo -create sansapatcher-ppc sansapatcher-i386 -output sansapatcher-mac
|
|
|
|
|
|
|
|
sansapatcher-i386: main.c sansapatcher.c sansaio-posix.c parttypes.h bootimg.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.c
|
|
|
|
strip sansapatcher-i386
|
|
|
|
|
|
|
|
sansapatcher-ppc: main.c sansapatcher.c sansaio-posix.c parttypes.h bootimg.c
|
|
|
|
gcc -arch ppc $(CFLAGS) -o sansapatcher-ppc main.c sansapatcher.c sansaio-posix.c bootimg.c
|
|
|
|
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-03-15 23:26:47 +00:00
|
|
|
bootimg.c: PP5022.mi4 bin2c
|
|
|
|
./bin2c PP5022.mi4 bootimg
|
2007-03-15 22:55:36 +00:00
|
|
|
|
|
|
|
clean:
|
2007-03-15 23:26:47 +00:00
|
|
|
rm -f sansapatcher.exe sansapatcher-mac sansapatcher-i386 sansapatcher-ppc sansapatcher bin2c bootimg.c bootimg.h *~
|