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