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