]> git.saurik.com Git - cycript.git/blame - makefile
Hierarchialization.
[cycript.git] / makefile
CommitLineData
ea2d184c
JF
1ifndef PKG_TARG
2target :=
3else
4target := $(PKG_TARG)-
5endif
6
62ca2b82
JF
7package:
8
c1582939 9name := Cyrver
ea2d184c
JF
10flags := -framework CFNetwork -framework JavaScriptCore -framework WebCore -install_name /usr/lib/libcyrver.dylib -I.
11menes := $(shell cd ~; pwd)/menes
12
13link := -framework CoreFoundation -framework Foundation -F${PKG_ROOT}/System/Library/PrivateFrameworks -L$(menes)/mobilesubstrate -lsubstrate -lapr-1 -lffi
14
15all: $(name).dylib $(control)
16
17clean:
18 rm -f $(name).dylib
19
04450da0
JF
20Struct.hpp:
21 $$($(target)gcc -print-prog-name=cc1obj) -print-objc-runtime-info </dev/null >$@
22
23$(name).dylib: Tweak.mm makefile $(menes)/mobilesubstrate/substrate.h sig/*.[ch]pp Struct.hpp
ea2d184c
JF
24 $(target)g++ -save-temps -dynamiclib -mthumb -g0 -O2 -Wall -Werror -o $@ $(filter %.cpp,$^) $(filter %.mm,$^) -lobjc -I$(menes)/mobilesubstrate $(link) $(flags)
25 ldid -S $@
26
27package: all
28 rm -rf package
29 mkdir -p package/DEBIAN
30 mkdir -p package/Library/MobileSubstrate/DynamicLibraries
31 cp -a control $(control) package/DEBIAN
32 if [[ -e Settings.plist ]]; then \
33 mkdir -p package/Library/PreferenceLoader/Preferences; \
34 cp -a Settings.png package/Library/PreferenceLoader/Preferences/$(name)Icon.png; \
35 cp -a Settings.plist package/Library/PreferenceLoader/Preferences/$(name).plist; \
36 fi
37 if [[ -e Tweak.plist ]]; then cp -a Tweak.plist package/Library/MobileSubstrate/DynamicLibraries/$(name).plist; fi
38 cp -a $(name).dylib package/Library/MobileSubstrate/DynamicLibraries
39 $(MAKE) extra
40 dpkg-deb -b package $(shell grep ^Package: control | cut -d ' ' -f 2-)_$(shell grep ^Version: control | cut -d ' ' -f 2)_iphoneos-arm.deb
41
42extra:
43
44%: %.mm
45 $(target)g++ -o $@ -Wall -Werror $< -lobjc -framework CoreFoundation -framework Foundation
46
47.PHONY: all clean extra package
62ca2b82
JF
48
49all: cyrver
50
51extra:
52 mkdir -p package/usr/{bin,lib}
53 mv package/Library/MobileSubstrate/DynamicLibraries/Cyrver.dylib package/usr/lib/libcyrver.dylib
54 ln -s /usr/lib/libcyrver.dylib package/Library/MobileSubstrate/DynamicLibraries/Cyrver.dylib
55 cp -a cyrver package/usr/bin
56
57cyrver: Application.mm Cyrver.dylib
58 $(target)g++ -g0 -O2 -Wall -Werror -o $@ $(filter %.mm,$^) -framework UIKit -framework Foundation -framework CoreFoundation -lobjc Cyrver.dylib -framework JavaScriptCore -F${PKG_ROOT}/System/Library/PrivateFrameworks
59 ldid -S cyrver