X-Git-Url: https://git.saurik.com/cycript.git/blobdiff_plain/bd17e6f377db6c9cc21c99bf58b7f4e3b618ea83..ff783f8c150e04f83969f56b88a8764ac050f671:/makefile diff --git a/makefile b/makefile index a4c2478..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: @@ -17,18 +20,20 @@ clean: libcycript.plist: Bridge.def { \ echo '({'; \ - sed -e 's/^C/0/;s/^F/1/;s/^V/2/' Bridge.def | while read -r line; do \ + 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//\"/\\\"}\");"; \ done; \ echo '},{'; \ - grep ^: Bridge.def | sed -e 's/^: \([^ ]*\) \(.*\)/"\1" = "\2";/'; \ + 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; \ echo '})'; \ } >$@ @@ -73,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; \ @@ -87,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 + dpkg -i $(deb) cycript test.cy .PHONY: all clean extra package