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