arch armv6 arm-apple-darwin10 iphoneos5.1 iphoneos
arch armv7 arm-apple-darwin10 iphoneos iphoneos
+arch armv7s arm-apple-darwin10 iphoneos iphoneos
arch i386 i386-apple-darwin10 iphonesimulator ios-simulator
libffi=()
.DELETE_ON_ERROR:
SHELL := /bin/bash
+lipo := $(shell xcrun --sdk iphoneos -f lipo)
+
libs :=
libs += .libs/cycript
libs += .libs/libcycript.dylib
@
endef
-$(foreach arch,armv6 armv7,$(eval $(call build_ios,$(arch))))
+$(foreach arch,armv6 armv7 armv7s,$(eval $(call build_ios,$(arch))))
define build_sim
.PHONY: build-sim-$(1)
.libs/%: build.mac-i386/.libs/% build.mac-x86_64/.libs/% build.ios-armv6/.libs/%
@mkdir -p .libs
- lipo -create -output $@ $^
-
-.libs/%-ios.a: build.ios-armv6/.libs/%.a build.ios-armv7/.libs/%.a build.sim/.libs/%.a
- @mkdir -p .libs
- lipo -create -output $@ $^
+ $(lipo) -create -output $@ $^
.libs/libcycript-sys.dylib:
@mkdir -p .libs
.libs/libcycript-%.o: build.%/.libs/libcycript.a
@mkdir -p .libs
- 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 $< libffi.a
-.libs/libcycript.o: .libs/libcycript-ios-armv6.o .libs/libcycript-ios-armv7.o .libs/libcycript-sim-i386.o
- lipo -create -output $@ $^
+.libs/libcycript.o: .libs/libcycript-ios-armv6.o .libs/libcycript-ios-armv7.o .libs/libcycript-ios-armv7s.o .libs/libcycript-sim-i386.o
+ $(lipo) -create -output $@ $^
cycript: cycript.in
cp -af $< $@
local flg=$3
shift 3
- configure "${dir}" "${sdk}" "${flg}" "$@" --enable-static --with-pic #CPPFLAGS="-idirafter ${mac}/usr/include"
+ configure "${dir}" "${sdk}" "${flg}" "$@" --enable-static --with-pic
}
for arch in i386; do
build "sim-${arch}" iphonesimulator "-arch ${arch} -mios-simulator-version-min=2.0" OBJCXXFLAGS="-fobjc-abi-version=2 -fobjc-legacy-dispatch" CPPFLAGS="-I../libffi.${arch}/include" LDFLAGS="-L.." --disable-console
done
-for arch in armv6 armv7; do
- build "ios-${arch}" iphoneos5.1 "-arch ${arch} -miphoneos-version-min=2.0" --host=arm-apple-darwin10 CPPFLAGS="-I../libffi.${arch}/include -I../sysroot.ios/usr/include -I../sysroot.ios/usr/include/apr-1" LTLIBAPR="../sysroot.ios/usr/lib/libapr-1.dylib" LDFLAGS="-L.. -L../sysroot.ios/usr/lib"
+for arch in armv6 armv7 armv7s; do
+ if [[ ${arch} == armv6 ]]; then
+ sdk=iphoneos5.1
+ flg=()
+ else
+ sdk=iphoneos
+ flg=(--disable-console)
+ fi
+
+ build "ios-${arch}" "${sdk}" "-arch ${arch} -miphoneos-version-min=2.0" --host=arm-apple-darwin10 CPPFLAGS="-I../libffi.${arch}/include -I../sysroot.ios/usr/include -I../sysroot.ios/usr/include/apr-1" LTLIBAPR="../sysroot.ios/usr/lib/libapr-1.dylib" LDFLAGS="-L.. -L../sysroot.ios/usr/lib" "${flg[@]}"
done