]> git.saurik.com Git - cydia.git/blame - makefile
Move -[CYTabBarController statusBarHeight] to ::CYStatusBarHeight().
[cydia.git] / makefile
CommitLineData
0263db76 1sdks := /Developer/Platforms/iPhoneOS.platform/Developer/SDKs
ea958716 2ioss := $(sort $(patsubst $(sdks)/iPhoneOS%.sdk,%,$(wildcard $(sdks)/iPhoneOS*.sdk)))
0263db76 3
ea958716 4ios := $(word $(words $(ioss)),$(ioss))
670fdb01 5gcc := 4.2
c21004b9
JF
6
7flags :=
8link :=
9
d1ba8fd3
JF
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
c21004b9 18dpkg := dpkg-deb
d1ba8fd3 19endif
c21004b9 20
0263db76 21sdk := $(sdks)/iPhoneOS$(ios).sdk
ee4120ad
JF
22
23flags += -F$(sdk)/System/Library/PrivateFrameworks
c21004b9
JF
24flags += -I. -isystem sysroot/usr/include -Lsysroot/usr/lib
25flags += -Wall -Werror -Wno-deprecated-declarations
26flags += -fmessage-length=0
27flags += -g0 -O2
7c8912f8 28flags += -fobjc-exceptions
443b9e05 29flags += -fno-guess-branch-probability
9f9ae81c 30flags += -fvisibility=hidden
7c8912f8
JF
31
32xflags :=
33xflags += -fobjc-call-cxx-cdtors
9f9ae81c 34xflags += -fvisibility-inlines-hidden
c21004b9
JF
35
36link += -framework CoreFoundation
37link += -framework CoreGraphics
38link += -framework Foundation
39link += -framework GraphicsServices
40link += -framework IOKit
41link += -framework JavaScriptCore
42link += -framework QuartzCore
0e371502 43link += -framework SpringBoardServices
c21004b9 44link += -framework SystemConfiguration
c21004b9
JF
45link += -framework WebCore
46link += -framework WebKit
47
48link += -lapr-1
49link += -lapt-pkg
50link += -lpcre
51
52link += -multiply_defined suppress
5f6bff8c 53
e17a8c4f
JF
54uikit :=
55uikit += -framework UIKit
56
57backrow :=
58backrow += -FAppleTV -framework BackRow -framework AppleTV
59
f9ba524a
JF
60version := $(shell ./version.sh)
61
ee4120ad 62#cycc = cycc -r4.2 -i$(ios) -o$@
89b0ea4a 63gxx := /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/g++-$(gcc)
435cb857 64cycc = $(gxx) -mthumb -arch armv6 -o $@ -mcpu=arm1176jzf-s -miphoneos-version-min=2.0 -isysroot $(sdk) -idirafter /usr/include -F{sysroot,}/Library/Frameworks
ee4120ad 65
7c8912f8
JF
66flags += -DCYDIA_VERSION='"$(version)"'
67
68dirs := Menes CyteKit Cydia SDURLCache
69
70code := $(foreach dir,$(dirs),$(wildcard $(foreach ext,h hpp c cpp m mm,$(dir)/*.$(ext))))
71code := $(filter-out SDURLCache/SDURLCacheTests.m,$(code))
72code += MobileCydia.mm iPhonePrivate.h Cytore.hpp lookup3.c
73
74source := $(filter %.m,$(code)) $(filter %.mm,$(code))
75source += $(filter %.c,$(code)) $(filter %.cpp,$(code))
76header := $(filter %.h,$(code)) $(filter %.hpp,$(code))
77
78object := $(source)
79object := $(object:.c=.o)
80object := $(object:.cpp=.o)
81object := $(object:.m=.o)
82object := $(object:.mm=.o)
83object := $(object:%=Objects/%)
84
8a4d4662
JF
85images := $(shell find MobileCydia.app -name '*.png')
86images := $(images:%=Images/%)
87
915284a6
JF
88lproj_deb := debs/cydia-lproj_$(version)_iphoneos-arm.deb
89
e17a8c4f 90all: MobileCydia
dc5812ec 91
5f6bff8c 92clean:
e17a8c4f 93 rm -f MobileCydia
8a4d4662 94 rm -rf Objects/ Images/
7c8912f8
JF
95
96Objects/%.o: %.c $(header)
97 @mkdir -p $(dir $@)
98 @echo "[cycc] $<"
99 @$(cycc) -c -o $@ -x c $<
100
101Objects/%.o: %.m $(header)
102 @mkdir -p $(dir $@)
103 @echo "[cycc] $<"
104 @$(cycc) -c -o $@ $< $(flags)
5f6bff8c 105
7c8912f8
JF
106Objects/%.o: %.mm $(header)
107 @mkdir -p $(dir $@)
108 @echo "[cycc] $<"
109 @$(cycc) -c -o $@ $< $(flags) $(xflags)
e95a1972 110
8a4d4662
JF
111Images/%.png: %.png
112 @mkdir -p $(dir $@)
113 @echo "[pngc] $<"
114 @./pngcrush.sh $< $@
115
8a2c6d14
JF
116sysroot:
117 @echo "Please read compiling.txt: you do not have a ./sysroot/ folder with the on-device requirements." 1>&2
118 @echo 1>&2
119 @exit 1
120
7c8912f8
JF
121MobileCydia: sysroot $(object)
122 @echo "[link] $(object:Objects/%=%)"
123 @$(cycc) $(filter %.o,$^) $(flags) $(link) $(uikit)
443b9e05
JF
124 @echo "[strp] $@"
125 @strip -no_uuid $@
7c8912f8 126 @echo "[sign] $@"
443b9e05 127 @ldid -T0 -Slaunch.xml $@ || { rm -f $@ && false; }
03c0f7a9 128
e17a8c4f
JF
129CydiaAppliance: CydiaAppliance.mm
130 $(cycc) $(filter %.mm,$^) $(flags) -bundle $(link) $(backrow)
131
aa60b57b 132debs/cydia_$(version)_iphoneos-arm.deb: MobileCydia $(images) $(shell find MobileCydia.app)
7e2bd591 133 sudo rm -rf _
03c0f7a9
JF
134 mkdir -p _/var/lib/cydia
135
136 mkdir -p _/usr/libexec
c21004b9 137 cp -a Library _/usr/libexec/cydia
7e2bd591 138 cp -a sysroot/usr/bin/du _/usr/libexec/cydia
03c0f7a9
JF
139
140 mkdir -p _/System/Library
c21004b9 141 cp -a LaunchDaemons _/System/Library/LaunchDaemons
03c0f7a9
JF
142
143 mkdir -p _/Applications
e17a8c4f 144 cp -a MobileCydia.app _/Applications/Cydia.app
915284a6 145 rm -rf _/Applications/Cydia.app/*.lproj
e17a8c4f
JF
146 cp -a MobileCydia _/Applications/Cydia.app/MobileCydia
147
8a4d4662
JF
148 cd MobileCydia.app && find . -name '*.png' -exec cp -af ../Images/MobileCydia.app/{} ../_/Applications/Cydia.app/{} ';'
149
e2b57be4
JF
150 #mkdir -p _/Applications/AppleTV.app/Appliances
151 #cp -a Cydia.frappliance _/Applications/AppleTV.app/Appliances
152 #cp -a CydiaAppliance _/Applications/AppleTV.app/Appliances/Cydia.frappliance
153
e17a8c4f 154 #mkdir -p _/Applications/Lowtide.app/Appliances
e2b57be4 155 #ln -s {/Applications/AppleTV,_/Applications/Lowtide}.app/Appliances/Cydia.frappliance
03c0f7a9 156
03c0f7a9 157 mkdir -p _/DEBIAN
915284a6 158 ./control.sh cydia.control _ >_/DEBIAN/control
35ee8548 159 cp -a preinst _/DEBIAN/
03c0f7a9 160
8fec9d25 161 find _ -exec touch -t "$$(date -j -f "%s" +"%Y%m%d%H%M.%S" "$$(git show --format='format:%ct' | head -n 1)")" {} ';'
7fc02989 162
7e2bd591
JF
163 sudo chown -R 0 _
164 sudo chgrp -R 0 _
e17a8c4f 165 sudo chmod 6755 _/Applications/Cydia.app/MobileCydia
7e2bd591 166
3adcfba7 167 mkdir -p debs
f9ba524a 168 ln -sf debs/cydia_$(version)_iphoneos-arm.deb Cydia.deb
3adcfba7 169 $(dpkg) -b _ Cydia.deb
ce0372db 170 @echo "$$(stat -L -f "%z" Cydia.deb) $$(stat -f "%Y" Cydia.deb)"
8cc774c5 171
915284a6
JF
172$(lproj_deb): $(shell find MobileCydia.app -name '*.strings')
173 sudo rm -rf __
174 mkdir -p __/Applications/Cydia.app
175
176 cp -a MobileCydia.app/*.lproj __/Applications/Cydia.app
177
178 mkdir -p __/DEBIAN
179 ./control.sh cydia-lproj.control __ >__/DEBIAN/control
180 cp -a preinst __/DEBIAN/
181
182 sudo chown -R 0 __
183 sudo chgrp -R 0 __
184
185 mkdir -p debs
186 ln -sf debs/cydia-lproj_$(version)_iphoneos-arm.deb Cydia_.deb
187 $(dpkg) -b __ Cydia_.deb
188 @echo "$$(stat -L -f "%z" Cydia_.deb) $$(stat -f "%Y" Cydia_.deb)"
189
190package: debs/cydia_$(version)_iphoneos-arm.deb $(lproj_deb)
aa60b57b
JF
191
192.PHONY: all clean package sign