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.dmg
: sansapatcher-mac
38 mkdir
-p sansapatcher-dmg
39 cp
-p sansapatcher-mac sansapatcher-dmg
/sansapatcher
40 hdiutil create
-srcfolder sansapatcher-dmg sansapatcher.dmg
42 sansapatcher-i386
: main.c sansapatcher.c sansaio-posix.c parttypes.h bootimg_c200.c bootimg_e200.c
43 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
44 strip sansapatcher-i386
46 sansapatcher-ppc
: main.c sansapatcher.c sansaio-posix.c parttypes.h bootimg_c200.c bootimg_e200.c
47 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
48 strip sansapatcher-ppc
50 bootimg_c200.c
: firmware.mi4 ..
/tools
/bin2c
51 ..
/tools
/bin2c firmware.mi4 bootimg_c200
53 bootimg_e200.c
: PP5022.mi4 ..
/tools
/bin2c
54 ..
/tools
/bin2c PP5022.mi4 bootimg_e200
57 make
-C ..
/tools bin2c
60 rm -f sansapatcher.exe sansapatcher-mac sansapatcher-i386 sansapatcher-ppc sansapatcher bootimg_c200.c bootimg_c200.h bootimg_e200.c bootimg_e200.h
*~ sansapatcher.dmg
61 rm -rf sansapatcher-dmg