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