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