diff options
Diffstat (limited to 'rbutil/sansapatcher/Makefile')
-rw-r--r-- | rbutil/sansapatcher/Makefile | 91 |
1 files changed, 40 insertions, 51 deletions
diff --git a/rbutil/sansapatcher/Makefile b/rbutil/sansapatcher/Makefile index 05739245b9..6e203042be 100644 --- a/rbutil/sansapatcher/Makefile +++ b/rbutil/sansapatcher/Makefile | |||
@@ -1,62 +1,51 @@ | |||
1 | CFLAGS=-Wall -W -D_LARGEFILE64_SOURCE | 1 | # __________ __ ___. |
2 | 2 | # Open \______ \ ____ ____ | | _\_ |__ _______ ___ | |
3 | ifeq ($(findstring CYGWIN,$(shell uname)),CYGWIN) | 3 | # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / |
4 | OUTPUT=sansapatcher.exe | 4 | # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < |
5 | CROSS= | 5 | # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ |
6 | CFLAGS+=-mno-cygwin | 6 | # \/ \/ \/ \/ \/ |
7 | else | 7 | |
8 | ifeq ($(findstring MINGW,$(shell uname)),MINGW) | 8 | TARGET_DIR ?= $(shell pwd)/ |
9 | OUTPUT=sansapatcher.exe | 9 | CFLAGS += -Wall -W -D_LARGEFILE64_SOURCE |
10 | CROSS= | 10 | |
11 | CFLAGS+=-D__USE_MINGW_ANSI_STDIO=1 | 11 | OUTPUT = sansapatcher |
12 | else | 12 | |
13 | OUTPUT=sansapatcher | 13 | # inputs |
14 | CROSS=i586-mingw32msvc- | 14 | BOOTSRC = bootimg_c200.c bootimg_e200.c |
15 | LIBSOURCES := sansapatcher.c sansaio-posix.c sansaio-win32.c | ||
16 | SOURCES := $(LIBSOURCES) main.c | ||
17 | # additional link dependencies for the standalone executable | ||
18 | EXTRADEPS := | ||
19 | |||
20 | # Releases of sansapatcher are created with "make RELEASE=1". This | ||
21 | # enables BOOTOBJS and uses the VERSION string defined in main.c | ||
22 | ifdef RELEASE | ||
23 | CFLAGS += -DRELEASE | ||
24 | BOOTOBJS=1 | ||
15 | endif | 25 | endif |
16 | endif | ||
17 | |||
18 | NATIVECC = gcc | ||
19 | CC = $(CROSS)gcc | ||
20 | WINDRES = $(CROSS)windres | ||
21 | 26 | ||
22 | all: $(OUTPUT) | 27 | ifdef WITH_BOOTOBJS |
28 | SOURCES += $(BOOTSRC) | ||
29 | CFLAGS += -DWITH_BOOTOBJS | ||
30 | endif | ||
23 | 31 | ||
24 | sansapatcher: main.c sansapatcher.c sansaio-posix.c parttypes.h bootimg_c200.c bootimg_e200.c | 32 | include ../libtools.make |
25 | gcc $(CFLAGS) -o sansapatcher main.c sansapatcher.c sansaio-posix.c bootimg_c200.c bootimg_e200.c | ||
26 | strip sansapatcher | ||
27 | 33 | ||
28 | sansapatcher.exe: main.c sansapatcher.c sansaio-win32.c parttypes.h bootimg_c200.c bootimg_e200.c sansapatcher-rc.o | 34 | # find out if we need to link the manifest resource. |
29 | $(CC) $(CFLAGS) -o sansapatcher.exe main.c sansapatcher.c sansaio-win32.c bootimg_c200.c bootimg_e200.c sansapatcher-rc.o | 35 | # Since libtools.make sets up BINARY we check it for the file extension .exe. |
30 | $(CROSS)strip sansapatcher.exe | 36 | ifeq ($(findstring exe,$(BINARY)),exe) |
37 | $(BINARY): $(OBJDIR)sansapatcher-rc.o | ||
38 | endif | ||
31 | 39 | ||
32 | sansapatcher-rc.o: sansapatcher.rc sansapatcher.manifest | 40 | $(OBJDIR)sansapatcher-rc.o: sansapatcher.rc sansapatcher.manifest |
33 | $(WINDRES) -i sansapatcher.rc -o sansapatcher-rc.o | 41 | $(WINDRES) -i sansapatcher.rc -o sansapatcher-rc.o |
34 | |||
35 | sansapatcher-mac: sansapatcher-i386 sansapatcher-ppc | ||
36 | lipo -create sansapatcher-ppc sansapatcher-i386 -output sansapatcher-mac | ||
37 | |||
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 | ||
42 | |||
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 | ||
46 | |||
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 | ||
50 | 42 | ||
51 | bootimg_c200.c: firmware.mi4 ../tools/bin2c | 43 | bootimg_c200.c: firmware.mi4 ../tools/bin2c |
52 | ../tools/bin2c firmware.mi4 bootimg_c200 | 44 | @echo BIN2C $< |
45 | $(SILENT)../tools/bin2c firmware.mi4 bootimg_c200 | ||
53 | 46 | ||
54 | bootimg_e200.c: PP5022.mi4 ../tools/bin2c | 47 | bootimg_e200.c: PP5022.mi4 ../tools/bin2c |
55 | ../tools/bin2c PP5022.mi4 bootimg_e200 | 48 | @echo BIN2C $< |
56 | 49 | $(SILENT)../tools/bin2c PP5022.mi4 bootimg_e200 | |
57 | ../tools/bin2c: | 50 | ../tools/bin2c: |
58 | make -C ../tools bin2c | 51 | $(SILENT)make -C ../tools bin2c |
59 | |||
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 | ||