1 sdks := /Developer/Platforms/iPhoneOS.platform/Developer/SDKs
2 ioss := $(sort $(patsubst $(sdks)/iPhoneOS%.sdk,%,$(wildcard $(sdks)/iPhoneOS*.sdk)))
4 ios := $(word $(words $(ioss)),$(ioss))
10 ifeq (o,O) # gzip is actually better
11 dpkg := /Library/Cydia/bin/dpkg-deb
12 ifeq ($(wildcard $(dpkg)),$(dpkg))
13 dpkg := $(dpkg) -zlzma
15 dpkg := dpkg-deb -zbzip2
21 sdk := $(sdks)/iPhoneOS$(ios).sdk
23 flags += -F$(sdk)/System/Library/PrivateFrameworks
24 flags += -I. -isystem sysroot/usr/include -Lsysroot/usr/lib
25 flags += -Wall -Werror -Wno-deprecated-declarations
26 flags += -fmessage-length=0
28 flags += -fobjc-call-cxx-cdtors -fobjc-exceptions
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
37 link += -framework SpringBoardServices
38 link += -framework SystemConfiguration
39 link += -framework WebCore
40 link += -framework WebKit
46 link += -multiply_defined suppress
49 uikit += -framework UIKit
52 backrow += -FAppleTV -framework BackRow -framework AppleTV
54 version := $(shell ./version.sh)
56 #cycc = cycc -r4.2 -i$(ios) -o$@
57 gxx := /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/g++-$(gcc)
58 cycc = $(gxx) -mthumb -arch armv6 -o $@ -mcpu=arm1176jzf-s -miphoneos-version-min=2.0 -isysroot $(sdk) -idirafter /usr/include -F/Library/Frameworks
66 $(cycc) -c -o $@ -x c $<
69 @echo "Please read compiling.txt: you do not have a ./sysroot/ folder with the on-device requirements." 1>&2
73 MobileCydia: sysroot MobileCydia.mm UICaboodle/*.h UICaboodle/*.mm SDURLCache/SDURLCache.h SDURLCache/SDURLCache.m iPhonePrivate.h lookup3.o Cytore.hpp
74 $(cycc) $(filter %.mm,$^) $(filter %.o,$^) $(foreach m,$(filter %.m,$^),-x objective-c++ $(m)) $(flags) $(link) $(uikit) -DCYDIA_VERSION='"$(version)"'
75 ldid -Slaunch.xml $@ || { rm -f $@ && false; }
77 CydiaAppliance: CydiaAppliance.mm
78 $(cycc) $(filter %.mm,$^) $(flags) -bundle $(link) $(backrow)
82 mkdir -p _/var/lib/cydia
84 mkdir -p _/usr/libexec
85 cp -a Library _/usr/libexec/cydia
86 cp -a sysroot/usr/bin/du _/usr/libexec/cydia
88 mkdir -p _/System/Library
89 cp -a LaunchDaemons _/System/Library/LaunchDaemons
91 mkdir -p _/Applications
92 cp -a MobileCydia.app _/Applications/Cydia.app
93 cp -a MobileCydia _/Applications/Cydia.app/MobileCydia
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
99 mkdir -p _/System/Library/PreferenceBundles
100 cp -a CydiaSettings.bundle _/System/Library/PreferenceBundles/CydiaSettings.bundle
103 ./control.sh _ >_/DEBIAN/control
105 find _ -name '*.png' -exec ./pngcrush.sh '{}' ';'
109 sudo chmod 6755 _/Applications/Cydia.app/MobileCydia
112 ln -sf debs/cydia_$(version)_iphoneos-arm.deb Cydia.deb
113 $(dpkg) -b _ Cydia.deb
114 @echo "$$(stat -L -f "%z" Cydia.deb) $$(stat -f "%Y" Cydia.deb)"
116 .PHONY: all clean sign