]> git.saurik.com Git - cydia.git/blame - makefile
Separate out Menes/radixSortWithSelector.*.
[cydia.git] / makefile
CommitLineData
0263db76 1sdks := /Developer/Platforms/iPhoneOS.platform/Developer/SDKs
ea958716 2ioss := $(sort $(patsubst $(sdks)/iPhoneOS%.sdk,%,$(wildcard $(sdks)/iPhoneOS*.sdk)))
0263db76 3
ea958716 4ios := $(word $(words $(ioss)),$(ioss))
670fdb01 5gcc := 4.2
c21004b9
JF
6
7flags :=
8link :=
9
d1ba8fd3
JF
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
c21004b9 18dpkg := dpkg-deb
d1ba8fd3 19endif
c21004b9 20
0263db76 21sdk := $(sdks)/iPhoneOS$(ios).sdk
ee4120ad
JF
22
23flags += -F$(sdk)/System/Library/PrivateFrameworks
c21004b9
JF
24flags += -I. -isystem sysroot/usr/include -Lsysroot/usr/lib
25flags += -Wall -Werror -Wno-deprecated-declarations
26flags += -fmessage-length=0
27flags += -g0 -O2
7c8912f8
JF
28flags += -fobjc-exceptions
29
30xflags :=
31xflags += -fobjc-call-cxx-cdtors
c21004b9
JF
32
33link += -framework CoreFoundation
34link += -framework CoreGraphics
35link += -framework Foundation
36link += -framework GraphicsServices
37link += -framework IOKit
38link += -framework JavaScriptCore
39link += -framework QuartzCore
0e371502 40link += -framework SpringBoardServices
c21004b9 41link += -framework SystemConfiguration
c21004b9
JF
42link += -framework WebCore
43link += -framework WebKit
44
45link += -lapr-1
46link += -lapt-pkg
47link += -lpcre
48
49link += -multiply_defined suppress
5f6bff8c 50
e17a8c4f
JF
51uikit :=
52uikit += -framework UIKit
53
54backrow :=
55backrow += -FAppleTV -framework BackRow -framework AppleTV
56
f9ba524a
JF
57version := $(shell ./version.sh)
58
ee4120ad 59#cycc = cycc -r4.2 -i$(ios) -o$@
89b0ea4a 60gxx := /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/g++-$(gcc)
435cb857 61cycc = $(gxx) -mthumb -arch armv6 -o $@ -mcpu=arm1176jzf-s -miphoneos-version-min=2.0 -isysroot $(sdk) -idirafter /usr/include -F{sysroot,}/Library/Frameworks
ee4120ad 62
7c8912f8
JF
63flags += -DCYDIA_VERSION='"$(version)"'
64
65dirs := Menes CyteKit Cydia SDURLCache
66
67code := $(foreach dir,$(dirs),$(wildcard $(foreach ext,h hpp c cpp m mm,$(dir)/*.$(ext))))
68code := $(filter-out SDURLCache/SDURLCacheTests.m,$(code))
69code += MobileCydia.mm iPhonePrivate.h Cytore.hpp lookup3.c
70
71source := $(filter %.m,$(code)) $(filter %.mm,$(code))
72source += $(filter %.c,$(code)) $(filter %.cpp,$(code))
73header := $(filter %.h,$(code)) $(filter %.hpp,$(code))
74
75object := $(source)
76object := $(object:.c=.o)
77object := $(object:.cpp=.o)
78object := $(object:.m=.o)
79object := $(object:.mm=.o)
80object := $(object:%=Objects/%)
81
e17a8c4f 82all: MobileCydia
dc5812ec 83
5f6bff8c 84clean:
e17a8c4f 85 rm -f MobileCydia
7c8912f8
JF
86 rm -rf Objects/
87
88Objects/%.o: %.c $(header)
89 @mkdir -p $(dir $@)
90 @echo "[cycc] $<"
91 @$(cycc) -c -o $@ -x c $<
92
93Objects/%.o: %.m $(header)
94 @mkdir -p $(dir $@)
95 @echo "[cycc] $<"
96 @$(cycc) -c -o $@ $< $(flags)
5f6bff8c 97
7c8912f8
JF
98Objects/%.o: %.mm $(header)
99 @mkdir -p $(dir $@)
100 @echo "[cycc] $<"
101 @$(cycc) -c -o $@ $< $(flags) $(xflags)
e95a1972 102
8a2c6d14
JF
103sysroot:
104 @echo "Please read compiling.txt: you do not have a ./sysroot/ folder with the on-device requirements." 1>&2
105 @echo 1>&2
106 @exit 1
107
7c8912f8
JF
108MobileCydia: sysroot $(object)
109 @echo "[link] $(object:Objects/%=%)"
110 @$(cycc) $(filter %.o,$^) $(flags) $(link) $(uikit)
111 @echo "[sign] $@"
112 @ldid -Slaunch.xml $@ || { rm -f $@ && false; }
03c0f7a9 113
e17a8c4f
JF
114CydiaAppliance: CydiaAppliance.mm
115 $(cycc) $(filter %.mm,$^) $(flags) -bundle $(link) $(backrow)
116
117package: MobileCydia
7e2bd591 118 sudo rm -rf _
03c0f7a9
JF
119 mkdir -p _/var/lib/cydia
120
121 mkdir -p _/usr/libexec
c21004b9 122 cp -a Library _/usr/libexec/cydia
7e2bd591 123 cp -a sysroot/usr/bin/du _/usr/libexec/cydia
03c0f7a9
JF
124
125 mkdir -p _/System/Library
c21004b9 126 cp -a LaunchDaemons _/System/Library/LaunchDaemons
03c0f7a9
JF
127
128 mkdir -p _/Applications
e17a8c4f
JF
129 cp -a MobileCydia.app _/Applications/Cydia.app
130 cp -a MobileCydia _/Applications/Cydia.app/MobileCydia
131
132 #mkdir -p _/Applications/Lowtide.app/Appliances
133 #cp -a Cydia.frappliance _/Applications/Lowtide.app/Appliances
134 #cp -a CydiaAppliance _/Applications/Lowtide.app/Appliances/Cydia.frappliance
03c0f7a9 135
03c0f7a9 136 mkdir -p _/DEBIAN
3adcfba7 137 ./control.sh _ >_/DEBIAN/control
03c0f7a9 138
7fc02989
JF
139 find _ -name '*.png' -exec ./pngcrush.sh '{}' ';'
140
7e2bd591
JF
141 sudo chown -R 0 _
142 sudo chgrp -R 0 _
e17a8c4f 143 sudo chmod 6755 _/Applications/Cydia.app/MobileCydia
7e2bd591 144
3adcfba7 145 mkdir -p debs
f9ba524a 146 ln -sf debs/cydia_$(version)_iphoneos-arm.deb Cydia.deb
3adcfba7 147 $(dpkg) -b _ Cydia.deb
ce0372db 148 @echo "$$(stat -L -f "%z" Cydia.deb) $$(stat -f "%Y" Cydia.deb)"
8cc774c5
JF
149
150.PHONY: all clean sign