9 flags := -framework CFNetwork -framework JavaScriptCore -framework WebCore -install_name /usr/lib/libcycript.dylib -I.
10 menes := $(shell cd ~; pwd)/menes
12 link := -framework CoreFoundation -framework Foundation -F${PKG_ROOT}/System/Library/PrivateFrameworks -L$(menes)/mobilesubstrate -lsubstrate -lapr-1 -lffi
14 all: cycript libcycript.dylib libcycript.plist
17 rm -f libcycript.dylib cycript libcycript.plist Struct.hpp lex.cy.c Cycript.tab.cc Cycript.tab.hh location.hh position.hh
19 libcycript.plist: Bridge.def makefile
20 sed -e 's/^C/0/;s/^F/1/;s/^V/2/' Bridge.def | while read -r line; do \
21 if [[ $$line == '' ]]; then \
25 if [[ $$1 =~ [#fl] ]]; then \
28 echo "$$2 = ($$1, \"$$3\");"; \
31 Cycript.tab.cc Cycript.tab.hh: Cycript.y makefile
38 $$($(target)gcc -print-prog-name=cc1obj) -print-objc-runtime-info </dev/null >$@
40 #Parser.hpp: Parser.py Parser.dat
41 # ./Parser.py <Parser.dat >$@
43 libcycript.dylib: Library.mm makefile $(menes)/mobilesubstrate/substrate.h sig/*.[ch]pp Struct.hpp Parser.hpp lex.cy.c Cycript.tab.cc Cycript.tab.hh
44 $(target)g++ -dynamiclib -mthumb -g0 -O2 -Wall -Werror -o $@ $(filter %.cpp,$^) $(filter %.cc,$^) $(filter %.c,$^) $(filter %.mm,$^) -lobjc -I$(menes)/mobilesubstrate $(link) $(flags) #-DYYDEBUG=1
47 cycript: Application.mm libcycript.dylib
48 $(target)g++ -g0 -O2 -Wall -Werror -o $@ $(filter %.mm,$^) -framework UIKit -framework Foundation -framework CoreFoundation -lobjc libcycript.dylib
53 mkdir -p package/DEBIAN
54 cp -a control package/DEBIAN
55 mkdir -p package/Library/MobileSubstrate/DynamicLibraries
56 if [[ -e Settings.plist ]]; then \
57 mkdir -p package/Library/PreferenceLoader/Preferences; \
58 cp -a Settings.png package/Library/PreferenceLoader/Preferences/CycriptIcon.png; \
59 cp -a Settings.plist package/Library/PreferenceLoader/Preferences/Cycript.plist; \
61 if [[ -e Tweak.plist ]]; then cp -a Tweak.plist package/Library/MobileSubstrate/DynamicLibraries/Cycript.plist; fi
62 #cp -a Cycript.dylib package/Library/MobileSubstrate/DynamicLibraries
63 mkdir -p package/usr/{bin,lib}
64 cp -a libcycript.dylib package/usr/lib
65 #ln -s /usr/lib/libcycript.dylib package/Library/MobileSubstrate/DynamicLibraries/Cycript.dylib
66 cp -a cycript package/usr/bin
67 cp -a libcycript.plist package/usr/lib
68 dpkg-deb -b package $(shell grep ^Package: control | cut -d ' ' -f 2-)_$(shell grep ^Version: control | cut -d ' ' -f 2)_iphoneos-arm.deb
71 dpkg -i $(shell grep ^Package: control | cut -d ' ' -f 2-)_$(shell grep ^Version: control | cut -d ' ' -f 2)_iphoneos-arm.deb
74 .PHONY: all clean extra package