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