deb := cycript_$(version)_iphoneos-arm.deb
cycript :=
-cycript += Cycript_/cycript
+cycript += Cycript_/cycript_
cycript += Cycript_/libcycript.dylib
cycript += Cycript_/libcycript-any.dylib
cycript += Cycript_/libcycript-sys.dylib
package: cycript.zip
-$(deb): Cycript_/cycript Cycript_/libcycript.dylib
+$(deb): Cycript_/cycript_ Cycript_/libcycript.dylib
rm -rf package
mkdir -p package/DEBIAN
sed -e 's/#/$(version)/' control.in >package/DEBIAN/control
mkdir -p package/usr/{bin,lib}
- $(lipo) -extract armv6 -output package/usr/bin/cycript Cycript_/cycript
+ $(lipo) -extract armv6 -output package/usr/bin/cycript Cycript_/cycript_
$(lipo) -extract armv6 -extract arm64 -output package/usr/lib/libcycript.dylib Cycript_/libcycript.dylib
ln -s libcycript.dylib package/usr/lib/libcycript.0.dylib
dpkg-deb -Zlzma -b package $@
install_name_tool -change /System/Library/{,Private}Frameworks/JavaScriptCore.framework/JavaScriptCore $@
codesign -s $(codesign) --entitlement cycript-$(word 2,$(subst ., ,$(subst -, ,$*))).xml $@
-Cycript_/%: build.mac-i386/.libs/%_ build.mac-x86_64/.libs/%_ build.ios-armv6/.libs/%_
+Cycript_/cycript_: build.mac-i386/.libs/cycript_ build.mac-x86_64/.libs/cycript_ build.ios-armv6/.libs/cycript_
@mkdir -p $(dir $@)
$(lipo) -create -output $@ $^
$(lipo) -create -output $@ $^
codesign -s $(codesign) $@
-libcycript-%.o: build.%/.libs/libcycript.a
+libcycript-%.o: build.%/.libs/libcycript.a xcode.map
@mkdir -p $(dir $@)
- ld -r -arch $$($(lipo) -detailed_info $< | sed -e '/^Non-fat file: / ! d; s/.*: //') -o $@ -all_load $< libffi.a
+ ld -r -arch $$($(lipo) -detailed_info $< | sed -e '/^Non-fat file: / ! d; s/.*: //') -o $@ -all_load -exported_symbols_list xcode.map $< libffi.a
libcycript.o: libcycript-ios-armv6.o libcycript-ios-armv7.o libcycript-ios-armv7s.o libcycript-ios-arm64.o libcycript-sim-i386.o libcycript-sim-x86_64.o
$(lipo) -create -output $@ $^