]> git.saurik.com Git - cydia.git/blame - makefile
Use pngcrush to crush the images as we build the package.
[cydia.git] / makefile
CommitLineData
6666381a
JF
1sdks := /Developer/Platforms/iPhoneOS.platform/Developer/SDKs
2
1e4922b8 3ios := 3.2
e4e75caf
JF
4#ios := 2.0
5
6ifeq ($(patsubst 2%,2,$(ios)),2)
6666381a 7gcc := 4.0
e4e75caf
JF
8else
9gcc := 4.2
cbc40330 10endif
1e4922b8
JF
11
12flags :=
13link :=
14
f2527e9d
JF
15ifeq (o,O) # gzip is actually better
16dpkg := /Library/Cydia/bin/dpkg-deb
17ifeq ($(wildcard $(dpkg)),$(dpkg))
18dpkg := $(dpkg) -zlzma
19else
20dpkg := dpkg-deb -zbzip2
21endif
22else
1e4922b8 23dpkg := dpkg-deb
f2527e9d 24endif
1e4922b8 25
6666381a 26sdk := $(sdks)/iPhoneOS$(ios).sdk
ad8c38ed
JF
27
28flags += -F$(sdk)/System/Library/PrivateFrameworks
1e4922b8
JF
29flags += -I. -isystem sysroot/usr/include -Lsysroot/usr/lib
30flags += -Wall -Werror -Wno-deprecated-declarations
31flags += -fmessage-length=0
32flags += -g0 -O2
33flags += -fobjc-call-cxx-cdtors -fobjc-exceptions
34
35link += -framework CoreFoundation
36link += -framework CoreGraphics
37link += -framework Foundation
38link += -framework GraphicsServices
39link += -framework IOKit
40link += -framework JavaScriptCore
41link += -framework QuartzCore
92cb9864 42link += -framework SpringBoardServices
1e4922b8 43link += -framework SystemConfiguration
1e4922b8
JF
44link += -framework WebCore
45link += -framework WebKit
46
47link += -lapr-1
48link += -lapt-pkg
49link += -lpcre
50
51link += -multiply_defined suppress
b0d03ade 52
471937c6
JF
53uikit :=
54uikit += -framework UIKit
55
56backrow :=
57backrow += -FAppleTV -framework BackRow -framework AppleTV
58
ad8c38ed 59#cycc = cycc -r4.2 -i$(ios) -o$@
cbc40330 60gxx := /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/g++-$(gcc)
6e7cf305 61cycc = $(gxx) -mthumb -arch armv6 -o $@ -mcpu=arm1176jzf-s -miphoneos-version-min=2.0 -isysroot $(sdk) -idirafter /usr/include -F/Library/Frameworks
ad8c38ed 62
471937c6 63all: MobileCydia
a75f53e7 64
b0d03ade 65clean:
471937c6 66 rm -f MobileCydia
b0d03ade 67
8b5085e6
JF
68%.o: %.c
69 $(cycc) -c -o $@ -x c $<
70
e12c175e
JF
71MobileCydia: MobileCydia.mm UICaboodle/*.h UICaboodle/*.mm SDURLCache/SDURLCache.h SDURLCache/SDURLCache.m iPhonePrivate.h lookup3.o Cytore.hpp
72 $(cycc) $(filter %.mm,$^) $(filter %.o,$^) $(foreach m,$(filter %.m,$^),-x objective-c++ $(m)) $(flags) $(link) $(uikit)
c1cb3a17 73 ldid -Slaunch.xml $@ || { rm -f $@ && false; }
5511bfb1 74
471937c6
JF
75CydiaAppliance: CydiaAppliance.mm
76 $(cycc) $(filter %.mm,$^) $(flags) -bundle $(link) $(backrow)
77
78package: MobileCydia
393ab8b9 79 sudo rm -rf _
5511bfb1
JF
80 mkdir -p _/var/lib/cydia
81
82 mkdir -p _/usr/libexec
1e4922b8 83 cp -a Library _/usr/libexec/cydia
393ab8b9 84 cp -a sysroot/usr/bin/du _/usr/libexec/cydia
5511bfb1
JF
85
86 mkdir -p _/System/Library
1e4922b8 87 cp -a LaunchDaemons _/System/Library/LaunchDaemons
5511bfb1
JF
88
89 mkdir -p _/Applications
471937c6
JF
90 cp -a MobileCydia.app _/Applications/Cydia.app
91 cp -a MobileCydia _/Applications/Cydia.app/MobileCydia
92
93 #mkdir -p _/Applications/Lowtide.app/Appliances
94 #cp -a Cydia.frappliance _/Applications/Lowtide.app/Appliances
95 #cp -a CydiaAppliance _/Applications/Lowtide.app/Appliances/Cydia.frappliance
5511bfb1
JF
96
97 mkdir -p _/System/Library/PreferenceBundles
1e4922b8 98 cp -a CydiaSettings.bundle _/System/Library/PreferenceBundles/CydiaSettings.bundle
5511bfb1
JF
99
100 mkdir -p _/DEBIAN
9b3dc53f 101 ./control.sh _ >_/DEBIAN/control
5511bfb1 102
b491043d
JF
103 find _ -name '*.png' -exec ./pngcrush.sh '{}' ';'
104
393ab8b9
JF
105 sudo chown -R 0 _
106 sudo chgrp -R 0 _
471937c6 107 sudo chmod 6755 _/Applications/Cydia.app/MobileCydia
393ab8b9 108
9b3dc53f
JF
109 mkdir -p debs
110 ln -sf debs/cydia_$$(./version.sh)_iphoneos-arm.deb Cydia.deb
111 $(dpkg) -b _ Cydia.deb
9f1ff1e5 112 @echo "$$(stat -L -f "%z" Cydia.deb) $$(stat -f "%Y" Cydia.deb)"
23bcd525
JF
113
114.PHONY: all clean sign