X-Git-Url: https://git.saurik.com/cycript.git/blobdiff_plain/478d4ed0925f2e61fbcdc4672104620342c52c4c..f33b048af6516bdeff373d3eb709f3d445233dc4:/makefile diff --git a/makefile b/makefile index c893967..3b3229d 100644 --- a/makefile +++ b/makefile @@ -9,6 +9,9 @@ package: flags := -mthumb -g3 -O0 -Wall -Werror -I. -fno-common flags += -F${PKG_ROOT}/System/Library/PrivateFrameworks +svn := $(shell svnversion) +deb := $(shell grep ^Package: control | cut -d ' ' -f 2-)_$(shell grep ^Version: control | cut -d ' ' -f 2 | sed -e 's/\#/$(svn)/')_iphoneos-arm.deb + all: cycript libcycript.dylib libcycript.plist clean: @@ -16,17 +19,22 @@ clean: libcycript.plist: Bridge.def { \ - sed -e 's/^C/0/;s/^F/1/;s/^V/2/' Bridge.def | while read -r line; do \ + echo '({'; \ + grep '^[CFV]' Bridge.def | sed -e 's/^C/0/;s/^F/1/;s/^V/2/' | while read -r line; do \ if [[ $$line == '' ]]; then \ continue; \ fi; \ set $$line; \ - if [[ $$1 =~ [#fl:] ]]; then \ - continue; \ - fi; \ - echo "$$2 = ($$1, \"$$3\");"; \ + echo "$$2 = ($$1, \"$${3//\"/\\\"}\");"; \ + done; \ + echo '},{'; \ + grep '^:' Bridge.def | sed -e 's/^: \([^ ]*\) \(.*\)/"\1" = "\2";/'; \ + echo '},{'; \ + grep '^S' Bridge.def | sed -e 's/^S/0/' | while read -r line; do \ + set $$line; \ + echo "$$2 = ($$1, \"$${3//\"/\\\"}\");"; \ done; \ - grep ^: Bridge.def | sed -e 's/^: \([^ ]*\) \(.*\)/":\1" = "\2";/'; \ + echo '})'; \ } >$@ Cycript.tab.cc Cycript.tab.hh location.hh position.hh: Cycript.y @@ -56,7 +64,7 @@ Output.o: Output.cpp Parser.hpp Pooling.hpp Library.o: Library.mm Cycript.tab.hh Parser.hpp Pooling.hpp Struct.hpp cycript.hpp $(target)g++ $(flags) -c -o $@ $< -Application.o: Application.cpp Cycript.tab.hh Parser.hpp Pooling.hpp cycript.hpp +Application.o: Application.mm Cycript.tab.hh Parser.hpp Pooling.hpp cycript.hpp $(target)g++ $(flags) -c -o $@ $< libcycript.dylib: ffi_type.o parse.o Output.o Cycript.tab.o lex.cy.o Library.o @@ -70,7 +78,7 @@ cycript: Application.o libcycript.dylib package: all rm -rf package mkdir -p package/DEBIAN - cp -a control package/DEBIAN + sed -e 's/#/$(svn)/' control >package/DEBIAN/control mkdir -p package/Library/MobileSubstrate/DynamicLibraries if [[ -e Settings.plist ]]; then \ mkdir -p package/Library/PreferenceLoader/Preferences; \ @@ -84,10 +92,10 @@ package: all #ln -s /usr/lib/libcycript.dylib package/Library/MobileSubstrate/DynamicLibraries/Cycript.dylib cp -a cycript package/usr/bin cp -a libcycript.plist package/usr/lib - dpkg-deb -b package $(shell grep ^Package: control | cut -d ' ' -f 2-)_$(shell grep ^Version: control | cut -d ' ' -f 2)_iphoneos-arm.deb + dpkg-deb -b package $(deb) test: package - dpkg -i $(shell grep ^Package: control | cut -d ' ' -f 2-)_$(shell grep ^Version: control | cut -d ' ' -f 2)_iphoneos-arm.deb - cycript /Applications/HelloCycript.app/HelloCycript + dpkg -i $(deb) + cycript test.cy .PHONY: all clean extra package