]> git.saurik.com Git - cycript.git/blobdiff - xcode.mk
Remove APR dependency: getopt_long actually works.
[cycript.git] / xcode.mk
index 35f0a4fdc4a9dc7b21256bc1717adf82121fdd43..b72d40d40d81a2edf74ff2f0bd1f5deabfc2b380 100644 (file)
--- a/xcode.mk
+++ b/xcode.mk
@@ -24,7 +24,9 @@ include codesign.mk
 
 lipo := $(shell xcrun --sdk iphoneos -f lipo)
 
+monotonic := $(shell git log -1 --pretty=format:%ct)
 version := $(shell git describe --always --tags --dirty="+" --match="v*" | sed -e 's@-\([^-]*\)-\([^-]*\)$$@+\1.\2@;s@^v@@;s@%@~@g')
+
 deb := cycript_$(version)_iphoneos-arm.deb
 zip := cycript_$(version).zip
 
@@ -32,7 +34,6 @@ cycript :=
 cycript += Cycript.lib/cycript
 cycript += Cycript.lib/cycript0.9
 cycript += Cycript.lib/libcycript.dylib
-cycript += Cycript.lib/libcycript-any.dylib
 cycript += Cycript.lib/libcycript-sys.dylib
 cycript += Cycript.lib/libcycript-sim.dylib
 
@@ -40,17 +41,18 @@ framework :=
 framework += Cycript
 framework += Headers/Cycript.h
 
-framework := $(foreach os,ios mac,$(foreach file,$(framework),Cycript-$(os).framework/$(file)))
+framework := $(foreach os,ios osx,$(foreach file,$(framework),Cycript.$(os)/Cycript.framework/$(file)))
 
 links := 
 links += Cycript.lib/libsubstrate.dylib
 links += Cycript.lib/cycript0.9
 
-all: cycript $(cycript) $(framework)
+all := cycript $(cycript) $(framework)
+all: $(all)
 
-$(zip): all
+$(zip): $(all)
        rm -f $@
-       zip -r9y $@ cycript Cycript.lib Cycript-{ios,mac}.framework $(patsubst %,--exclude %,$(links))
+       zip -r9y $@ cycript Cycript.lib Cycript.{ios,osx} $(patsubst %,--exclude %,$(links))
        zip -r9 $@ $(links)
 
 zip: $(zip)
@@ -89,14 +91,14 @@ build.$(1)-$(2)/.libs/libcycript.dylib: build-$(1)-$(2)
        @
 endef
 
-define build_mac
-$(call build_any,mac,$(1))
-$(call build_lib,mac,$(1))
-build.mac-$(1)/.libs/cycript: build-mac-$(1)
+define build_osx
+$(call build_any,osx,$(1))
+$(call build_lib,osx,$(1))
+build.osx-$(1)/.libs/cycript: build-osx-$(1)
        @
 endef
 
-$(foreach arch,i386 x86_64,$(eval $(call build_mac,$(arch))))
+$(foreach arch,i386 x86_64,$(eval $(call build_osx,$(arch))))
 
 define build_ios
 $(call build_any,ios,$(1))
@@ -107,8 +109,6 @@ $(foreach arch,armv6 armv7 armv7s arm64,$(eval $(call build_ios,$(arch))))
 define build_sim
 $(call build_any,sim,$(1))
 $(call build_lib,sim,$(1))
-build.sim-$(1)/.libs/libcycript-any.dylib: build-sim-$(1)
-       @
 endef
 
 $(foreach arch,i386 x86_64,$(eval $(call build_sim,$(arch))))
@@ -126,12 +126,7 @@ endef
 
 $(foreach arch,armv6 arm64,$(eval $(call build_arm,$(arch))))
 
-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.mac-x86_64/.libs/libcycript.dylib build.ios-armv6/.libs/libcycript.dylib build.ios-arm64/.libs/libcycript.dylib
+Cycript.lib/libcycript.dylib: build.osx-i386/.libs/libcycript.dylib build.osx-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 $@
@@ -142,7 +137,7 @@ Cycript.lib/libcycript.dylib: build.mac-i386/.libs/libcycript.dylib build.mac-x8
        install_name_tool -change /System/Library/{,Private}Frameworks/JavaScriptCore.framework/JavaScriptCore $@
        codesign -s $(codesign) --entitlement cycript-$(word 2,$(subst ., ,$(subst -, ,$*))).xml $@
 
-Cycript.lib/%: build.mac-i386/.libs/%_ build.mac-x86_64/.libs/%_ build.ios-armv6/.libs/%_
+Cycript.lib/%: build.osx-i386/.libs/%_ build.osx-x86_64/.libs/%_ build.ios-armv6/.libs/%_
        @mkdir -p $(dir $@)
        $(lipo) -create -output $@ $^
 
@@ -162,14 +157,14 @@ libcycript-%.o: build.%/.libs/libcycript.a xcode.map
 libcycript-ios.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 $@ $^
 
-libcycript-mac.o: libcycript-mac-i386.o libcycript-mac-x86_64.o
+libcycript-osx.o: libcycript-osx-i386.o libcycript-osx-x86_64.o
        $(lipo) -create -output $@ $^
 
-Cycript-%.framework/Cycript: libcycript-%.o
+Cycript.%/Cycript.framework/Cycript: libcycript-%.o
        @mkdir -p $(dir $@)
        cp -a $< $@
 
-Cycript-%.framework/Headers/Cycript.h: Cycript.h
+Cycript.%/Cycript.framework/Headers/Cycript.h: Cycript.h
        @mkdir -p $(dir $@)
        cp -a $< $@
 
@@ -181,8 +176,12 @@ cycript: cycript.in
        cp -af $< $@
        chmod 755 $@
 
-install: Cycript.lib/cycript Cycript.lib/libcycript.dylib Cycript.lib/libcycript-sys.dylib Cycript.lib/libcycript-any.dylib Cycript.lib/libcycript-sim.dylib
+install: Cycript.lib/cycript Cycript.lib/libcycript.dylib Cycript.lib/libcycript-sys.dylib Cycript.lib/libcycript-sim.dylib
        sudo cp -af $(filter-out %.dylib,$^) /usr/bin
        sudo cp -af $(filter %.dylib,$^) /usr/lib
 
-.PHONY: all clean install package
+
+cast: $(zip)
+       appcast.sh cycript/mac $(monotonic) $(version) $< "$(CYCRIPT_CHANGES)"
+
+.PHONY: all cast clean install zip