]> git.saurik.com Git - cydia.git/blame_incremental - makefile
Fit ManageController to CyteWebViewController {custom,right}Button API.
[cydia.git] / makefile
... / ...
CommitLineData
1sdks := /Developer/Platforms/iPhoneOS.platform/Developer/SDKs
2ioss := $(sort $(patsubst $(sdks)/iPhoneOS%.sdk,%,$(wildcard $(sdks)/iPhoneOS*.sdk)))
3
4ios := $(word $(words $(ioss)),$(ioss))
5gcc := 4.2
6
7flags :=
8link :=
9
10ifeq (o,O) # gzip is actually better
11dpkg := /Library/Cydia/bin/dpkg-deb
12ifeq ($(wildcard $(dpkg)),$(dpkg))
13dpkg := $(dpkg) -zlzma
14else
15dpkg := dpkg-deb -zbzip2
16endif
17else
18dpkg := dpkg-deb
19endif
20
21sdk := $(sdks)/iPhoneOS$(ios).sdk
22
23flags += -F$(sdk)/System/Library/PrivateFrameworks
24flags += -I. -isystem sysroot/usr/include -Lsysroot/usr/lib
25flags += -Wall -Werror -Wno-deprecated-declarations
26flags += -fmessage-length=0
27flags += -g0 -O2
28flags += -fobjc-call-cxx-cdtors -fobjc-exceptions
29
30link += -framework CoreFoundation
31link += -framework CoreGraphics
32link += -framework Foundation
33link += -framework GraphicsServices
34link += -framework IOKit
35link += -framework JavaScriptCore
36link += -framework QuartzCore
37link += -framework SpringBoardServices
38link += -framework SystemConfiguration
39link += -framework WebCore
40link += -framework WebKit
41
42link += -lapr-1
43link += -lapt-pkg
44link += -lpcre
45
46link += -multiply_defined suppress
47
48uikit :=
49uikit += -framework UIKit
50
51backrow :=
52backrow += -FAppleTV -framework BackRow -framework AppleTV
53
54version := $(shell ./version.sh)
55
56#cycc = cycc -r4.2 -i$(ios) -o$@
57gxx := /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/g++-$(gcc)
58cycc = $(gxx) -mthumb -arch armv6 -o $@ -mcpu=arm1176jzf-s -miphoneos-version-min=2.0 -isysroot $(sdk) -idirafter /usr/include -F{sysroot,}/Library/Frameworks
59
60all: MobileCydia
61
62clean:
63 rm -f MobileCydia
64
65%.o: %.c
66 $(cycc) -c -o $@ -x c $<
67
68sysroot:
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
73MobileCydia: 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
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; }
76
77CydiaAppliance: CydiaAppliance.mm
78 $(cycc) $(filter %.mm,$^) $(flags) -bundle $(link) $(backrow)
79
80package: MobileCydia
81 sudo rm -rf _
82 mkdir -p _/var/lib/cydia
83
84 mkdir -p _/usr/libexec
85 cp -a Library _/usr/libexec/cydia
86 cp -a sysroot/usr/bin/du _/usr/libexec/cydia
87
88 mkdir -p _/System/Library
89 cp -a LaunchDaemons _/System/Library/LaunchDaemons
90
91 mkdir -p _/Applications
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
98
99 mkdir -p _/DEBIAN
100 ./control.sh _ >_/DEBIAN/control
101
102 find _ -name '*.png' -exec ./pngcrush.sh '{}' ';'
103
104 sudo chown -R 0 _
105 sudo chgrp -R 0 _
106 sudo chmod 6755 _/Applications/Cydia.app/MobileCydia
107
108 mkdir -p debs
109 ln -sf debs/cydia_$(version)_iphoneos-arm.deb Cydia.deb
110 $(dpkg) -b _ Cydia.deb
111 @echo "$$(stat -L -f "%z" Cydia.deb) $$(stat -f "%Y" Cydia.deb)"
112
113.PHONY: all clean sign