fix build
[kugel-rb.git] / rbutil / sansapatcher / Makefile
blob05739245b9b4e012aba7f96e92b830767c36c29b
1 CFLAGS=-Wall -W -D_LARGEFILE64_SOURCE
3 ifeq ($(findstring CYGWIN,$(shell uname)),CYGWIN)
4 OUTPUT=sansapatcher.exe
5 CROSS=
6 CFLAGS+=-mno-cygwin
7 else
8 ifeq ($(findstring MINGW,$(shell uname)),MINGW)
9 OUTPUT=sansapatcher.exe
10 CROSS=
11 CFLAGS+=-D__USE_MINGW_ANSI_STDIO=1
12 else
13 OUTPUT=sansapatcher
14 CROSS=i586-mingw32msvc-
15 endif
16 endif
18 NATIVECC = gcc
19 CC = $(CROSS)gcc
20 WINDRES = $(CROSS)windres
22 all: $(OUTPUT)
24 sansapatcher: main.c sansapatcher.c sansaio-posix.c parttypes.h bootimg_c200.c bootimg_e200.c
25 gcc $(CFLAGS) -o sansapatcher main.c sansapatcher.c sansaio-posix.c bootimg_c200.c bootimg_e200.c
26 strip sansapatcher
28 sansapatcher.exe: main.c sansapatcher.c sansaio-win32.c parttypes.h bootimg_c200.c bootimg_e200.c sansapatcher-rc.o
29 $(CC) $(CFLAGS) -o sansapatcher.exe main.c sansapatcher.c sansaio-win32.c bootimg_c200.c bootimg_e200.c sansapatcher-rc.o
30 $(CROSS)strip sansapatcher.exe
32 sansapatcher-rc.o: sansapatcher.rc sansapatcher.manifest
33 $(WINDRES) -i sansapatcher.rc -o sansapatcher-rc.o
35 sansapatcher-mac: sansapatcher-i386 sansapatcher-ppc
36 lipo -create sansapatcher-ppc sansapatcher-i386 -output sansapatcher-mac
38 sansapatcher.dmg: sansapatcher-mac
39 mkdir -p sansapatcher-dmg
40 cp -p sansapatcher-mac sansapatcher-dmg/sansapatcher
41 hdiutil create -srcfolder sansapatcher-dmg sansapatcher.dmg
43 sansapatcher-i386: main.c sansapatcher.c sansaio-posix.c parttypes.h bootimg_c200.c bootimg_e200.c
44 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
45 strip sansapatcher-i386
47 sansapatcher-ppc: main.c sansapatcher.c sansaio-posix.c parttypes.h bootimg_c200.c bootimg_e200.c
48 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
49 strip sansapatcher-ppc
51 bootimg_c200.c: firmware.mi4 ../tools/bin2c
52 ../tools/bin2c firmware.mi4 bootimg_c200
54 bootimg_e200.c: PP5022.mi4 ../tools/bin2c
55 ../tools/bin2c PP5022.mi4 bootimg_e200
57 ../tools/bin2c:
58 make -C ../tools bin2c
60 clean:
61 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
62 rm -rf sansapatcher-dmg