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:
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\");"; \
+ 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 '})'; \
} >$@
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; \
#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