]> git.saurik.com Git - cycript.git/blob - makefile
I nailed the interactive parser!
[cycript.git] / makefile
1 ifndef PKG_TARG
2 target :=
3 else
4 target := $(PKG_TARG)-
5 endif
6
7 package:
8
9 flags := -mthumb -g3 -O0 -Wall -Werror -I.
10
11 all: cycript libcycript.dylib libcycript.plist
12
13 clean:
14 rm -f *.o libcycript.dylib cycript libcycript.plist Struct.hpp lex.cy.c Cycript.tab.cc Cycript.tab.hh location.hh position.hh
15
16 libcycript.plist: Bridge.def
17 sed -e 's/^C/0/;s/^F/1/;s/^V/2/' Bridge.def | while read -r line; do \
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
28 Cycript.tab.cc Cycript.tab.hh location.hh position.hh: Cycript.y
29 bison -v $<
30
31 lex.cy.c: Cycript.l
32 flex $<
33
34 Struct.hpp:
35 $$($(target)gcc -print-prog-name=cc1obj) -print-objc-runtime-info </dev/null >$@
36
37 #Parser.hpp: Parser.py Parser.dat
38 # ./Parser.py <Parser.dat >$@
39
40 %.o: sig/%.cpp
41 $(target)g++ -c -o $@ $< $(flags)
42
43 Cycript.tab.o: Cycript.tab.cc Cycript.tab.hh Parser.hpp Pooling.hpp
44 $(target)g++ -c -o $@ $< $(flags)
45
46 lex.cy.o: lex.cy.c Cycript.tab.hh Parser.hpp Pooling.hpp
47 $(target)g++ -c -o $@ $< $(flags)
48
49 Output.o: Output.cpp Parser.hpp Pooling.hpp
50 $(target)g++ -c -o $@ $< $(flags)
51
52 Library.o: Library.mm Cycript.tab.hh Parser.hpp Pooling.hpp Struct.hpp
53 $(target)g++ -c -o $@ $< $(flags)
54
55 libcycript.dylib: ffi_type.o parse.o Output.o Cycript.tab.o lex.cy.o Library.o
56 $(target)g++ -I. -dynamiclib -mthumb -g3 -O0 -Wall -Werror -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
57 ldid -S $@
58
59 cycript: Application.mm libcycript.dylib
60 $(target)g++ -g0 -O2 -Wall -Werror -o $@ $(filter %.mm,$^) -framework UIKit -framework Foundation -framework CoreFoundation -lobjc libcycript.dylib
61 ldid -S cycript
62
63 package: all
64 rm -rf package
65 mkdir -p package/DEBIAN
66 cp -a control package/DEBIAN
67 mkdir -p package/Library/MobileSubstrate/DynamicLibraries
68 if [[ -e Settings.plist ]]; then \
69 mkdir -p package/Library/PreferenceLoader/Preferences; \
70 cp -a Settings.png package/Library/PreferenceLoader/Preferences/CycriptIcon.png; \
71 cp -a Settings.plist package/Library/PreferenceLoader/Preferences/Cycript.plist; \
72 fi
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
75 mkdir -p package/usr/{bin,lib}
76 cp -a libcycript.dylib package/usr/lib
77 #ln -s /usr/lib/libcycript.dylib package/Library/MobileSubstrate/DynamicLibraries/Cycript.dylib
78 cp -a cycript package/usr/bin
79 cp -a libcycript.plist package/usr/lib
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
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
86 .PHONY: all clean extra package