]> git.saurik.com Git - cydia.git/blame_incremental - makefile
Simple change to search view: if the keyboard was shown before, show it again when...
[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-exceptions
29flags += -fno-guess-branch-probability
30flags += -fvisibility=hidden
31
32xflags :=
33xflags += -fobjc-call-cxx-cdtors
34xflags += -fvisibility-inlines-hidden
35
36link += -framework CoreFoundation
37link += -framework CoreGraphics
38link += -framework Foundation
39link += -framework GraphicsServices
40link += -framework IOKit
41link += -framework JavaScriptCore
42link += -framework QuartzCore
43link += -framework SpringBoardServices
44link += -framework SystemConfiguration
45link += -framework WebCore
46link += -framework WebKit
47
48link += -lapr-1
49link += -lapt-pkg
50link += -lpcre
51
52link += -multiply_defined suppress
53
54uikit :=
55uikit += -framework UIKit
56
57backrow :=
58backrow += -FAppleTV -framework BackRow -framework AppleTV
59
60version := $(shell ./version.sh)
61
62#cycc = cycc -r4.2 -i$(ios) -o$@
63gxx := /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/g++-$(gcc)
64cycc = $(gxx) -mthumb -arch armv6 -o $@ -mcpu=arm1176jzf-s -miphoneos-version-min=2.0 -isysroot $(sdk) -idirafter /usr/include -F{sysroot,}/Library/Frameworks
65
66dirs := Menes CyteKit Cydia SDURLCache
67
68code := $(foreach dir,$(dirs),$(wildcard $(foreach ext,h hpp c cpp m mm,$(dir)/*.$(ext))))
69code := $(filter-out SDURLCache/SDURLCacheTests.m,$(code))
70code += MobileCydia.mm Version.mm iPhonePrivate.h Cytore.hpp lookup3.c Sources.h Sources.mm
71
72source := $(filter %.m,$(code)) $(filter %.mm,$(code))
73source += $(filter %.c,$(code)) $(filter %.cpp,$(code))
74header := $(filter %.h,$(code)) $(filter %.hpp,$(code))
75
76object := $(source)
77object := $(object:.c=.o)
78object := $(object:.cpp=.o)
79object := $(object:.m=.o)
80object := $(object:.mm=.o)
81object := $(object:%=Objects/%)
82
83images := $(shell find MobileCydia.app/ -type f -name '*.png')
84images := $(images:%=Images/%)
85
86lproj_deb := debs/cydia-lproj_$(version)_iphoneos-arm.deb
87
88all: MobileCydia
89
90clean:
91 rm -f MobileCydia postinst
92 rm -rf Objects/ Images/
93
94Objects/%.o: %.c $(header)
95 @mkdir -p $(dir $@)
96 @echo "[cycc] $<"
97 @$(cycc) -c -o $@ -x c $<
98
99Objects/%.o: %.m $(header)
100 @mkdir -p $(dir $@)
101 @echo "[cycc] $<"
102 @$(cycc) -c -o $@ $< $(flags)
103
104Objects/%.o: %.mm $(header)
105 @mkdir -p $(dir $@)
106 @echo "[cycc] $<"
107 @$(cycc) -c -o $@ $< $(flags) $(xflags)
108
109Objects/Version.o: version.h
110
111Images/%.png: %.png
112 @mkdir -p $(dir $@)
113 @echo "[pngc] $<"
114 @./pngcrush.sh $< $@
115
116sysroot: sysroot.sh
117 @echo "Your ./sysroot/ is either missing or out of date. Please read compiling.txt for help." 1>&2
118 @echo 1>&2
119 @exit 1
120
121MobileCydia: sysroot $(object) entitlements.xml
122 @echo "[link] $(object:Objects/%=%)"
123 @$(cycc) $(filter %.o,$^) $(flags) $(link) $(uikit)
124 @mkdir -p bins
125 @cp -a $@ bins/$@-$(version)
126 @echo "[strp] $@"
127 @strip -no_uuid $@
128 @echo "[sign] $@"
129 @ldid -T0 -Sentitlements.xml $@ || { rm -f $@ && false; }
130
131CydiaAppliance: CydiaAppliance.mm
132 $(cycc) $(filter %.mm,$^) $(flags) -bundle $(link) $(backrow)
133
134cfversion: cfversion.mm
135 $(cycc) $(filter %.mm,$^) $(flags) -framework CoreFoundation
136 @ldid -T0 -S $@
137
138postinst: postinst.mm Sources.mm Sources.h CyteKit/stringWithUTF8Bytes.mm CyteKit/stringWithUTF8Bytes.h CyteKit/UCPlatform.h
139 $(cycc) $(filter %.mm,$^) $(flags) -framework CoreFoundation -framework Foundation -framework UIKit -lpcre
140 @ldid -T0 -S $@
141
142debs/cydia_$(version)_iphoneos-arm.deb: MobileCydia preinst postinst cfversion $(images) $(shell find MobileCydia.app) cydia.control Library/firmware.sh
143 sudo rm -rf _
144 mkdir -p _/var/lib/cydia
145
146 mkdir -p _/etc/apt
147 cp -a Trusted.gpg _/etc/apt/trusted.gpg.d
148 cp -a Sources.list _/etc/apt/sources.list.d
149
150 mkdir -p _/usr/libexec
151 cp -a Library _/usr/libexec/cydia
152 cp -a sysroot/usr/bin/du _/usr/libexec/cydia
153 cp -a cfversion _/usr/libexec/cydia
154
155 mkdir -p _/System/Library
156 cp -a LaunchDaemons _/System/Library/LaunchDaemons
157
158 mkdir -p _/Applications
159 cp -a MobileCydia.app _/Applications/Cydia.app
160 rm -rf _/Applications/Cydia.app/*.lproj
161 cp -a MobileCydia _/Applications/Cydia.app/MobileCydia
162
163 cd MobileCydia.app && find . -name '*.png' -exec cp -af ../Images/MobileCydia.app/{} ../_/Applications/Cydia.app/{} ';'
164
165 mkdir -p _/Applications/Cydia.app/Sources
166 ln -s /usr/share/bigboss/icons/bigboss.png _/Applications/Cydia.app/Sources/apt.bigboss.us.com.png
167 ln -s /usr/share/bigboss/icons/planetiphones.png _/Applications/Cydia.app/Sections/"Planet-iPhones Mods.png"
168
169 #mkdir -p _/Applications/AppleTV.app/Appliances
170 #cp -a Cydia.frappliance _/Applications/AppleTV.app/Appliances
171 #cp -a CydiaAppliance _/Applications/AppleTV.app/Appliances/Cydia.frappliance
172
173 #mkdir -p _/Applications/Lowtide.app/Appliances
174 #ln -s {/Applications/AppleTV,_/Applications/Lowtide}.app/Appliances/Cydia.frappliance
175
176 mkdir -p _/DEBIAN
177 ./control.sh cydia.control _ >_/DEBIAN/control
178 cp -a preinst postinst _/DEBIAN/
179
180 find _ -exec touch -t "$$(date -j -f "%s" +"%Y%m%d%H%M.%S" "$$(git show --format='format:%ct' | head -n 1)")" {} ';'
181
182 sudo chown -R 0 _
183 sudo chgrp -R 0 _
184 sudo chmod 6755 _/Applications/Cydia.app/MobileCydia
185
186 mkdir -p debs
187 ln -sf debs/cydia_$(version)_iphoneos-arm.deb Cydia.deb
188 $(dpkg) -b _ Cydia.deb
189 @echo "$$(stat -L -f "%z" Cydia.deb) $$(stat -f "%Y" Cydia.deb)"
190
191$(lproj_deb): $(shell find MobileCydia.app -name '*.strings') cydia-lproj.control
192 sudo rm -rf __
193 mkdir -p __/Applications/Cydia.app
194
195 cp -a MobileCydia.app/*.lproj __/Applications/Cydia.app
196
197 mkdir -p __/DEBIAN
198 ./control.sh cydia-lproj.control __ >__/DEBIAN/control
199
200 sudo chown -R 0 __
201 sudo chgrp -R 0 __
202
203 mkdir -p debs
204 ln -sf debs/cydia-lproj_$(version)_iphoneos-arm.deb Cydia_.deb
205 $(dpkg) -b __ Cydia_.deb
206 @echo "$$(stat -L -f "%z" Cydia_.deb) $$(stat -f "%Y" Cydia_.deb)"
207
208package: debs/cydia_$(version)_iphoneos-arm.deb $(lproj_deb)
209
210.PHONY: all clean package