+VERSION_NEW_LINKEDIT = -mmacosx-version-min=10.6
+VERSION_OLD_LINKEDIT = -mmacosx-version-min=10.4
+LD_NEW_LINKEDIT = -macosx_version_min 10.6
+
+CXX = $(shell xcrun -find clang++) -arch ${ARCH} ${SDKExtra}
+CXXFLAGS = -Wall -stdlib=libc++
+
+IOS_SDK = $(shell xcodebuild -sdk iphoneos7.0.internal -version Path)
+
+ifeq ($(ARCH),armv6)
+ LDFLAGS := -syslibroot $(IOS_SDK)
+ override FILEARCH = arm
+ CC = $(shell xcrun -find clang) -arch ${ARCH} -ccc-install-dir ${LD_PATH} -miphoneos-version-min=5.0 -isysroot $(IOS_SDK)
+ CXX = $(shell xcrun -find clang++) -arch ${ARCH} -ccc-install-dir ${LD_PATH} -miphoneos-version-min=5.0 -isysroot $(IOS_SDK)
+ VERSION_NEW_LINKEDIT = -miphoneos-version-min=4.0
+ VERSION_OLD_LINKEDIT = -miphoneos-version-min=3.0
+ LD_SYSROOT = -syslibroot $(IOS_SDK)
+ LD_NEW_LINKEDIT = -ios_version_min 4.0
+else
+ FILEARCH = $(ARCH)
+endif
+
+ifeq ($(ARCH),armv7)
+ LDFLAGS := -syslibroot $(IOS_SDK)
+ override FILEARCH = arm
+ CC = $(shell xcrun -find clang) -arch ${ARCH} -ccc-install-dir ${LD_PATH} -miphoneos-version-min=5.0 -isysroot $(IOS_SDK)
+ CXX = $(shell xcrun -find clang++) -arch ${ARCH} -ccc-install-dir ${LD_PATH} -miphoneos-version-min=5.0 -isysroot $(IOS_SDK)
+ VERSION_NEW_LINKEDIT = -miphoneos-version-min=4.0
+ VERSION_OLD_LINKEDIT = -miphoneos-version-min=3.0
+ LD_SYSROOT = -syslibroot $(IOS_SDK)
+ LD_NEW_LINKEDIT = -ios_version_min 4.0
+else
+ FILEARCH = $(ARCH)
+endif
+
+ifeq ($(ARCH),thumb)
+ LDFLAGS := -syslibroot $(IOS_SDK)
+ CCFLAGS += -mthumb
+ CXXFLAGS += -mthumb
+ override ARCH = armv6
+ override FILEARCH = arm
+ CC = $(shell xcrun -find clang) -arch ${ARCH} -ccc-install-dir ${LD_PATH} -miphoneos-version-min=5.0 -isysroot $(IOS_SDK)
+ CXX = $(shell xcrun -find clang++) -arch ${ARCH} -ccc-install-dir ${LD_PATH} -miphoneos-version-min=5.0 -isysroot $(IOS_SDK)
+ VERSION_NEW_LINKEDIT = -miphoneos-version-min=4.0
+ VERSION_OLD_LINKEDIT = -miphoneos-version-min=3.0
+ LD_SYSROOT = -syslibroot $(IOS_SDK)
+ LD_NEW_LINKEDIT = -ios_version_min 4.0
+else
+ FILEARCH = $(ARCH)
+endif
+
+ifeq ($(ARCH),thumb2)
+ LDFLAGS := -syslibroot $(IOS_SDK)
+ CCFLAGS += -mthumb
+ CXXFLAGS += -mthumb
+ override ARCH = armv7
+ override FILEARCH = arm
+ CC = $(shell xcrun -find clang) -arch ${ARCH} -ccc-install-dir ${LD_PATH} -miphoneos-version-min=5.0 -isysroot $(IOS_SDK)
+ CXX = $(shell xcrun -find clang++) -arch ${ARCH} -ccc-install-dir ${LD_PATH} -miphoneos-version-min=5.0 -isysroot $(IOS_SDK)
+ VERSION_NEW_LINKEDIT = -miphoneos-version-min=4.0
+ VERSION_OLD_LINKEDIT = -miphoneos-version-min=3.0
+ LD_SYSROOT = -syslibroot $(IOS_SDK)
+ LD_NEW_LINKEDIT = -ios_version_min 4.0
+else
+ FILEARCH = $(ARCH)
+endif