summaryrefslogtreecommitdiff
path: root/rbutil
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2011-12-16 20:10:29 +0000
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2011-12-16 20:10:29 +0000
commit472c02d0f7c8980b7ea9d5980d3bbd9befe81300 (patch)
tree512e5897d72878de7d775eefc7d78a0c8f0e5f56 /rbutil
parentd992536285e101ac5a57f8a81cd7bc4ff6a62225 (diff)
downloadrockbox-472c02d0f7c8980b7ea9d5980d3bbd9befe81300.tar.gz
rockbox-472c02d0f7c8980b7ea9d5980d3bbd9befe81300.zip
sansapatcher: use libtools.make.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31327 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'rbutil')
-rw-r--r--rbutil/sansapatcher/Makefile91
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 @@
1CFLAGS=-Wall -W -D_LARGEFILE64_SOURCE 1# __________ __ ___.
2 2# Open \______ \ ____ ____ | | _\_ |__ _______ ___
3ifeq ($(findstring CYGWIN,$(shell uname)),CYGWIN) 3# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4OUTPUT=sansapatcher.exe 4# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5CROSS= 5# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6CFLAGS+=-mno-cygwin 6# \/ \/ \/ \/ \/
7else 7
8ifeq ($(findstring MINGW,$(shell uname)),MINGW) 8TARGET_DIR ?= $(shell pwd)/
9OUTPUT=sansapatcher.exe 9CFLAGS += -Wall -W -D_LARGEFILE64_SOURCE
10CROSS= 10
11CFLAGS+=-D__USE_MINGW_ANSI_STDIO=1 11OUTPUT = sansapatcher
12else 12
13OUTPUT=sansapatcher 13# inputs
14CROSS=i586-mingw32msvc- 14BOOTSRC = bootimg_c200.c bootimg_e200.c
15LIBSOURCES := sansapatcher.c sansaio-posix.c sansaio-win32.c
16SOURCES := $(LIBSOURCES) main.c
17# additional link dependencies for the standalone executable
18EXTRADEPS :=
19
20# Releases of sansapatcher are created with "make RELEASE=1". This
21# enables BOOTOBJS and uses the VERSION string defined in main.c
22ifdef RELEASE
23CFLAGS += -DRELEASE
24BOOTOBJS=1
15endif 25endif
16endif
17
18NATIVECC = gcc
19CC = $(CROSS)gcc
20WINDRES = $(CROSS)windres
21 26
22all: $(OUTPUT) 27ifdef WITH_BOOTOBJS
28SOURCES += $(BOOTSRC)
29CFLAGS += -DWITH_BOOTOBJS
30endif
23 31
24sansapatcher: main.c sansapatcher.c sansaio-posix.c parttypes.h bootimg_c200.c bootimg_e200.c 32include ../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
28sansapatcher.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 36ifeq ($(findstring exe,$(BINARY)),exe)
37$(BINARY): $(OBJDIR)sansapatcher-rc.o
38endif
31 39
32sansapatcher-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
35sansapatcher-mac: sansapatcher-i386 sansapatcher-ppc
36 lipo -create sansapatcher-ppc sansapatcher-i386 -output sansapatcher-mac
37
38sansapatcher.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
43sansapatcher-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
47sansapatcher-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
51bootimg_c200.c: firmware.mi4 ../tools/bin2c 43bootimg_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
54bootimg_e200.c: PP5022.mi4 ../tools/bin2c 47bootimg_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
60clean:
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