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