]> git.saurik.com Git - cycript.git/commitdiff
Also build OS X target and use for libcycript-any.
authorJay Freeman (saurik) <saurik@saurik.com>
Wed, 4 Jun 2014 10:17:52 +0000 (03:17 -0700)
committerJay Freeman (saurik) <saurik@saurik.com>
Wed, 4 Jun 2014 10:17:52 +0000 (03:17 -0700)
xcode.mk
xcode.sh

index 053503a4fd3aad8ed7e31abfe06fc551b593ecf5..57c0d108a478fdc823df7a5cfb96bc2157d0fab3 100644 (file)
--- 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 $@
index 45b2ea94e5fc9fa347ccbb70e703c0815a399de3..ce511a9a48e50828e569e515a09d0140e83910fb 100755 (executable)
--- 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" \