Include the required headers. Strangely this only broke on linux. Also fix a warning.
[Rockbox.git] / rbutil / sansapatcher / Makefile
blobb05d8f32579f14fb9bbb19f63cbbad39a4692b94
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 OUTPUT=sansapatcher
9 CROSS=i586-mingw32msvc-
10 endif
12 NATIVECC = gcc
13 CC = $(CROSS)gcc
15 all: $(OUTPUT)
17 sansapatcher: main.c sansapatcher.c sansaio-posix.c parttypes.h bootimg.c
18 gcc $(CFLAGS) -o sansapatcher main.c sansapatcher.c sansaio-posix.c bootimg.c
19 strip sansapatcher
21 sansapatcher.exe: main.c sansapatcher.c sansaio-win32.c parttypes.h bootimg.c
22 $(CC) $(CFLAGS) -o sansapatcher.exe main.c sansapatcher.c sansaio-win32.c bootimg.c
23 $(CROSS)strip sansapatcher.exe
25 sansapatcher-mac: sansapatcher-i386 sansapatcher-ppc
26 lipo -create sansapatcher-ppc sansapatcher-i386 -output sansapatcher-mac
28 sansapatcher-i386: main.c sansapatcher.c sansaio-posix.c parttypes.h bootimg.c
29 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
30 strip sansapatcher-i386
32 sansapatcher-ppc: main.c sansapatcher.c sansaio-posix.c parttypes.h bootimg.c
33 gcc -arch ppc $(CFLAGS) -o sansapatcher-ppc main.c sansapatcher.c sansaio-posix.c bootimg.c
34 strip sansapatcher-ppc
36 bin2c: bin2c.c
37 $(NATIVECC) $(CFLAGS) -o bin2c bin2c.c
39 bootimg.c: PP5022.mi4 bin2c
40 ./bin2c PP5022.mi4 bootimg
42 clean:
43 rm -f sansapatcher.exe sansapatcher-mac sansapatcher-i386 sansapatcher-ppc sansapatcher bin2c bootimg.c bootimg.h *~