]>
Commit | Line | Data |
---|---|---|
ea2d184c JF |
1 | ifndef PKG_TARG |
2 | target := | |
3 | else | |
4 | target := $(PKG_TARG)- | |
5 | endif | |
6 | ||
62ca2b82 JF |
7 | package: |
8 | ||
e7ed5354 | 9 | flags := -mthumb -g3 -O0 -Wall -Werror -I. |
ea2d184c | 10 | |
262e358c | 11 | all: cycript libcycript.dylib libcycript.plist |
ea2d184c JF |
12 | |
13 | clean: | |
457afcc9 | 14 | rm -f *.o libcycript.dylib cycript libcycript.plist Struct.hpp lex.cy.c Cycript.tab.cc Cycript.tab.hh location.hh position.hh stack.hh |
ea2d184c | 15 | |
5999c315 | 16 | libcycript.plist: Bridge.def |
707bcb93 | 17 | sed -e 's/^C/0/;s/^F/1/;s/^V/2/' Bridge.def | while read -r line; do \ |
88c977fa JF |
18 | if [[ $$line == '' ]]; then \ |
19 | continue; \ | |
20 | fi; \ | |
21 | set $$line; \ | |
22 | if [[ $$1 =~ [#fl] ]]; then \ | |
23 | continue; \ | |
24 | fi; \ | |
25 | echo "$$2 = ($$1, \"$$3\");"; \ | |
26 | done >$@ | |
27 | ||
5999c315 | 28 | Cycript.tab.cc Cycript.tab.hh location.hh position.hh: Cycript.y |
e7ed5354 | 29 | bison -v --report=state $< |
e5332278 JF |
30 | |
31 | lex.cy.c: Cycript.l | |
32 | flex $< | |
33 | ||
04450da0 JF |
34 | Struct.hpp: |
35 | $$($(target)gcc -print-prog-name=cc1obj) -print-objc-runtime-info </dev/null >$@ | |
36 | ||
e5332278 JF |
37 | #Parser.hpp: Parser.py Parser.dat |
38 | # ./Parser.py <Parser.dat >$@ | |
39 | ||
5999c315 | 40 | %.o: sig/%.cpp |
457afcc9 | 41 | $(target)g++ $(flags) -c -o $@ $< |
5999c315 JF |
42 | |
43 | Cycript.tab.o: Cycript.tab.cc Cycript.tab.hh Parser.hpp Pooling.hpp | |
457afcc9 | 44 | $(target)g++ $(flags) -c -o $@ $< |
5999c315 JF |
45 | |
46 | lex.cy.o: lex.cy.c Cycript.tab.hh Parser.hpp Pooling.hpp | |
457afcc9 | 47 | $(target)g++ $(flags) -c -o $@ $< |
5999c315 JF |
48 | |
49 | Output.o: Output.cpp Parser.hpp Pooling.hpp | |
457afcc9 | 50 | $(target)g++ $(flags) -c -o $@ $< |
5999c315 JF |
51 | |
52 | Library.o: Library.mm Cycript.tab.hh Parser.hpp Pooling.hpp Struct.hpp | |
457afcc9 | 53 | $(target)g++ $(flags) -c -o $@ $< |
5999c315 JF |
54 | |
55 | libcycript.dylib: ffi_type.o parse.o Output.o Cycript.tab.o lex.cy.o Library.o | |
457afcc9 | 56 | $(target)g++ $(flags) -dynamiclib -o $@ $(filter %.o,$^) -lobjc -framework CFNetwork -framework JavaScriptCore -framework WebCore -install_name /usr/lib/libcycript.dylib -framework CoreFoundation -framework Foundation -F${PKG_ROOT}/System/Library/PrivateFrameworks -L$(menes)/mobilesubstrate -lsubstrate -lapr-1 -lffi |
ea2d184c JF |
57 | ldid -S $@ |
58 | ||
262e358c | 59 | cycript: Application.mm libcycript.dylib |
457afcc9 | 60 | $(target)g++ $(flags) -o $@ $(filter %.mm,$^) -framework UIKit -framework Foundation -framework CoreFoundation -lobjc libcycript.dylib |
262e358c JF |
61 | ldid -S cycript |
62 | ||
ea2d184c JF |
63 | package: all |
64 | rm -rf package | |
65 | mkdir -p package/DEBIAN | |
88c977fa | 66 | cp -a control package/DEBIAN |
ea2d184c | 67 | mkdir -p package/Library/MobileSubstrate/DynamicLibraries |
ea2d184c JF |
68 | if [[ -e Settings.plist ]]; then \ |
69 | mkdir -p package/Library/PreferenceLoader/Preferences; \ | |
262e358c JF |
70 | cp -a Settings.png package/Library/PreferenceLoader/Preferences/CycriptIcon.png; \ |
71 | cp -a Settings.plist package/Library/PreferenceLoader/Preferences/Cycript.plist; \ | |
ea2d184c | 72 | fi |
262e358c JF |
73 | if [[ -e Tweak.plist ]]; then cp -a Tweak.plist package/Library/MobileSubstrate/DynamicLibraries/Cycript.plist; fi |
74 | #cp -a Cycript.dylib package/Library/MobileSubstrate/DynamicLibraries | |
62ca2b82 | 75 | mkdir -p package/usr/{bin,lib} |
262e358c | 76 | cp -a libcycript.dylib package/usr/lib |
a2d9403c | 77 | #ln -s /usr/lib/libcycript.dylib package/Library/MobileSubstrate/DynamicLibraries/Cycript.dylib |
107e3ed0 JF |
78 | cp -a cycript package/usr/bin |
79 | cp -a libcycript.plist package/usr/lib | |
88c977fa JF |
80 | dpkg-deb -b package $(shell grep ^Package: control | cut -d ' ' -f 2-)_$(shell grep ^Version: control | cut -d ' ' -f 2)_iphoneos-arm.deb |
81 | ||
1dbba6cc JF |
82 | test: package |
83 | dpkg -i $(shell grep ^Package: control | cut -d ' ' -f 2-)_$(shell grep ^Version: control | cut -d ' ' -f 2)_iphoneos-arm.deb | |
84 | cycript | |
85 | ||
88c977fa | 86 | .PHONY: all clean extra package |