From: Jay Freeman (saurik) Date: Wed, 4 Jun 2014 10:17:52 +0000 (-0700) Subject: Also build OS X target and use for libcycript-any. X-Git-Tag: v0.9.502~17 X-Git-Url: https://git.saurik.com/cycript.git/commitdiff_plain/a412fff412d6e61bc81aba50bef15b5ee998ed02 Also build OS X target and use for libcycript-any. --- diff --git a/xcode.mk b/xcode.mk index 053503a..57c0d10 100644 --- a/xcode.mk +++ b/xcode.mk @@ -72,37 +72,38 @@ clean: # make stubbornly refuses to believe that these @'s are bugs # http://osdir.com/ml/help-make-gnu/2012-04/msg00008.html -define build_mac -.PHONY: build-mac-$(1) -build-mac-$(1): - $(MAKE) -C build.mac-$(1) -build.mac-$(1)/.libs/cycript: build-mac-$(1) +define build_any +.PHONY: build-$(1)-$(2) +build-$(1)-$(2): + $(MAKE) -C build.$(1)-$(2) +build.$(1)-$(2)/.libs/libcycript.a: build-$(1)-$(2) @ -build.mac-$(1)/.libs/libcycript.dylib: build-mac-$(1) +endef + +define build_lib +build.$(1)-$(2)/.libs/libcycript.dylib: build-$(1)-$(2) @ -build.mac-$(1)/.libs/libcycript-any.dylib: build-mac-$(1) +endef + +define build_mac +$(call build_any,mac,$(1)) +$(call build_lib,mac,$(1)) +build.mac-$(1)/.libs/cycript: build-mac-$(1) @ endef $(foreach arch,i386 x86_64,$(eval $(call build_mac,$(arch)))) define build_ios -.PHONY: build-ios-$(1) -build-ios-$(1): - $(MAKE) -C build.ios-$(1) -build.ios-$(1)/.libs/libcycript.a: build-ios-$(1) - @ +$(call build_any,ios,$(1)) endef $(foreach arch,armv6 armv7 armv7s arm64,$(eval $(call build_ios,$(arch)))) define build_sim -.PHONY: build-sim-$(1) -build-sim-$(1): - $(MAKE) -C build.sim-$(1) -build.sim-$(1)/.libs/libcycript.dylib: build-sim-$(1) - @ -build.sim-$(1)/.libs/libcycript.a: build-sim-$(1) +$(call build_any,sim,$(1)) +$(call build_lib,sim,$(1)) +build.sim-$(1)/.libs/libcycript-any.dylib: build-sim-$(1) @ endef @@ -116,13 +117,17 @@ endef $(foreach arch,armv6,$(eval $(call build_arm,$(arch)))) define build_arm -build.ios-$(1)/.libs/libcycript.dylib: build-ios-$(1) - @ +$(call build_lib,ios,$(1)) endef $(foreach arch,armv6 arm64,$(eval $(call build_arm,$(arch)))) -Cycript.lib/%.dylib: build.mac-i386/.libs/%.dylib build.mac-x86_64/.libs/%.dylib build.ios-armv6/.libs/%.dylib build.ios-arm64/.libs/%.dylib +Cycript.lib/libcycript-any.dylib: build.sim-i386/.libs/libcycript-any.dylib build.sim-x86_64/.libs/libcycript-any.dylib + @mkdir -p $(dir $@) + $(lipo) -create -output $@ $^ + codesign -s $(codesign) $@ + +Cycript.lib/libcycript.dylib: build.mac-i386/.libs/libcycript.dylib build.sim-x86_64/.libs/libcycript.dylib build.ios-armv6/.libs/libcycript.dylib build.ios-arm64/.libs/libcycript.dylib @mkdir -p $(dir $@) $(lipo) -create -output $@ $^ install_name_tool -change /System/Library/{,Private}Frameworks/JavaScriptCore.framework/JavaScriptCore $@ diff --git a/xcode.sh b/xcode.sh index 45b2ea9..ce511a9 100755 --- a/xcode.sh +++ b/xcode.sh @@ -66,11 +66,6 @@ function configure() { cd .. } -for arch in i386 x86_64; do - configure "mac-${arch}" "${mac}" "-arch ${arch} -mmacosx-version-min=10.6" \ - CPPFLAGS="-I../readline" LDFLAGS="-L../readline" -done - function build() { local dir=$1 local sdk=$2 @@ -80,6 +75,11 @@ function build() { configure "${dir}" "${sdk}" "${flg}" "$@" --enable-static --with-pic } +for arch in i386 x86_64; do + build "mac-${arch}" "${mac}" "-arch ${arch} -mmacosx-version-min=10.6" \ + CPPFLAGS="-I../readline" LDFLAGS="-L../readline" +done + for arch in i386 x86_64; do build "sim-${arch}" iphonesimulator "-arch ${arch} -mios-simulator-version-min=4.0" \ OBJCXXFLAGS="-fobjc-abi-version=2 -fobjc-legacy-dispatch" \