1 CFLAGS
=-Wall
-W
-D_LARGEFILE64_SOURCE
3 ifeq ($(findstring CYGWIN
,$(shell uname
)),CYGWIN
)
4 OUTPUT
=sansapatcher.exe
8 ifeq ($(findstring MINGW
,$(shell uname
)),MINGW
)
9 OUTPUT
=sansapatcher.exe
13 CROSS
=i586-mingw32msvc-
19 WINDRES
= $(CROSS
)windres
23 sansapatcher
: main.c sansapatcher.c sansaio-posix.c parttypes.h bootimg_c200.c bootimg_e200.c
24 gcc
$(CFLAGS
) -o sansapatcher main.c sansapatcher.c sansaio-posix.c bootimg_c200.c bootimg_e200.c
27 sansapatcher.exe
: main.c sansapatcher.c sansaio-win32.c parttypes.h bootimg_c200.c bootimg_e200.c sansapatcher-rc.o
28 $(CC
) $(CFLAGS
) -o sansapatcher.exe main.c sansapatcher.c sansaio-win32.c bootimg_c200.c bootimg_e200.c sansapatcher-rc.o
29 $(CROSS
)strip sansapatcher.exe
31 sansapatcher-rc.o
: sansapatcher.rc sansapatcher.manifest
32 $(WINDRES
) -i sansapatcher.rc
-o sansapatcher-rc.o
34 sansapatcher-mac
: sansapatcher-i386 sansapatcher-ppc
35 lipo
-create sansapatcher-ppc sansapatcher-i386
-output sansapatcher-mac
37 sansapatcher-i386
: main.c sansapatcher.c sansaio-posix.c parttypes.h bootimg_c200.c bootimg_e200.c
38 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
39 strip sansapatcher-i386
41 sansapatcher-ppc
: main.c sansapatcher.c sansaio-posix.c parttypes.h bootimg_c200.c bootimg_e200.c
42 gcc
-arch ppc
$(CFLAGS
) -o sansapatcher-ppc main.c sansapatcher.c sansaio-posix.c bootimg_c200.c bootimg_e200.c
43 strip sansapatcher-ppc
46 $(NATIVECC
) $(CFLAGS
) -o bin2c bin2c.c
48 bootimg_c200.c
: firmware.mi4 bin2c
49 .
/bin2c firmware.mi4 bootimg_c200
51 bootimg_e200.c
: PP5022.mi4 bin2c
52 .
/bin2c PP5022.mi4 bootimg_e200
55 rm -f sansapatcher.exe sansapatcher-mac sansapatcher-i386 sansapatcher-ppc sansapatcher bin2c bootimg_c200.c bootimg_c200.h bootimg_e200.c bootimg_e200.h
*~