2016-11-18 02:39:51 +03:00
|
|
|
# armv7s, armv7, arm64, i386, x86_64
|
2015-09-07 22:25:54 +03:00
|
|
|
ARCH=i386
|
2018-11-11 02:14:36 +03:00
|
|
|
SDK_VER=12.1
|
2016-01-18 21:38:35 +03:00
|
|
|
MIN_IOS_VER=8.0
|
2018-02-20 02:42:35 +03:00
|
|
|
# MIN_IOS_VER must be 8.0 or higher
|
2015-09-09 00:24:41 +03:00
|
|
|
OUTPUT_DIR=Bin/iOS
|
|
|
|
URHO_DIR=Urho3D/Urho3D_iOS
|
|
|
|
URHO_SOURCE_DIR=Urho3D/Source
|
2015-09-06 18:03:47 +03:00
|
|
|
|
2015-09-08 16:28:22 +03:00
|
|
|
ifeq ($(ARCH), i386)
|
2015-09-07 22:25:54 +03:00
|
|
|
TARGET=iPhoneSimulator
|
2016-11-18 02:39:51 +03:00
|
|
|
else ifeq ($(ARCH), x86_64)
|
|
|
|
TARGET=iPhoneSimulator
|
2015-09-08 16:28:22 +03:00
|
|
|
else
|
|
|
|
TARGET=iPhoneOS
|
|
|
|
endif
|
|
|
|
|
2015-12-13 19:50:43 +03:00
|
|
|
URHO_FLAGS=-I$(URHO_DIR)/include -I$(URHO_DIR)/include/Urho3D/ThirdParty -I$(URHO_DIR)/include/Urho3D/ThirdParty/Bullet -DURHO3D_NEON -DSTBI_NEON -DURHO3D_FILEWATCHER -DURHO3D_PROFILING -DURHO3D_LOGGING -DKNET_UNIX -DURHO3D_OPENGL -DURHO3D_NAVIGATION -DURHO3D_NETWORK -DURHO3D_PHYSICS -DURHO3D_URHO2D -DURHO3D_STATIC_DEFINE -DIOS
|
2016-11-26 20:26:18 +03:00
|
|
|
URHO_LIBS=-framework AudioToolbox -framework AVFoundation -framework CoreAudio -framework CoreGraphics -framework Foundation -framework OpenGLES -framework QuartzCore -framework UIKit -framework GameController -framework CoreMotion -Wl,-search_paths_first -Wl,-headerpad_max_install_names $(URHO_DIR)/lib/libUrho3D.a -ldl -lpthread
|
2017-09-06 03:44:25 +03:00
|
|
|
CXXFLAGS=-g -stdlib=libc++ -std=c++0x -Wno-address-of-temporary -Wno-return-type-c-linkage -Wno-c++11-extensions $(URHO_FLAGS)
|
2015-09-06 18:03:47 +03:00
|
|
|
|
|
|
|
XCODE_BASE=/Applications/Xcode.app/Contents
|
|
|
|
TARGET_BASE=$(XCODE_BASE)/Developer/Platforms/$(TARGET).platform
|
|
|
|
XCODE_FRAMEWORKS=$(TARGET_BASE)/Developer/SDKs/$(TARGET)$(SDK_VER).sdk/System/Library/Frameworks/
|
|
|
|
XCODE_INCLUDES=$(TARGET_BASE)/Developer/SDKs/$(TARGET)$(SDK_VER).sdk/usr/include
|
|
|
|
XCODE_SDK=$(XCODE_BASE)/Developer/Platforms/$(TARGET).platform/Developer/SDKs/$(TARGET)$(SDK_VER).sdk
|
|
|
|
|
2016-01-19 19:11:54 +03:00
|
|
|
CPP=clang++ -arch $(ARCH) -F$(XCODE_FRAMEWORKS) -I$(XCODE_INCLUDES) -fapplication-extension -mios-simulator-version-min=$(MIN_IOS_VER) -miphoneos-version-min=$(MIN_IOS_VER) -isysroot $(XCODE_SDK) $(CXXFLAGS) -msse3
|
2015-09-06 18:03:47 +03:00
|
|
|
|
2015-09-08 23:06:27 +03:00
|
|
|
Urho3D_IOS:
|
2018-03-05 12:01:33 +03:00
|
|
|
rm -rf $(URHO_DIR) && mkdir -p $(URHO_DIR) && $(URHO_SOURCE_DIR)/./cmake_ios.sh $(URHO_DIR) -DURHO3D_PCH=0 -DIPHONEOS_DEPLOYMENT_TARGET=$(MIN_IOS_VER) -DURHO3D_TOOLS=0 -DURHO3D_LUA=0 -DURHO3D_WEBP=0 -DURHO3D_ANGELSCRIPT=0 -DURHO3D_C++11=1
|
2015-09-08 23:06:27 +03:00
|
|
|
|
|
|
|
libUrho3D.a: Urho3D_IOS
|
|
|
|
ifeq ($(ARCH), i386)
|
2017-10-23 23:21:26 +03:00
|
|
|
cd $(URHO_DIR) && xcodebuild -arch "i386" IPHONEOS_DEPLOYMENT_TARGET=$(MIN_IOS_VER) ONLY_ACTIVE_ARCH=NO VALID_ARCHS="i386" -target Urho3D -sdk iphonesimulator$(SDK_VER)
|
2016-11-18 02:39:51 +03:00
|
|
|
else ifeq ($(ARCH), x86_64)
|
2017-10-23 23:21:26 +03:00
|
|
|
cd $(URHO_DIR) && xcodebuild -arch "x86_64" IPHONEOS_DEPLOYMENT_TARGET=$(MIN_IOS_VER) ONLY_ACTIVE_ARCH=NO VALID_ARCHS="x86_64" -target Urho3D -sdk iphonesimulator$(SDK_VER)
|
2015-09-08 23:06:27 +03:00
|
|
|
else
|
2017-10-23 23:21:26 +03:00
|
|
|
cd $(URHO_DIR) && xcodebuild ARCHS=$(ARCH) IPHONEOS_DEPLOYMENT_TARGET=$(MIN_IOS_VER) ONLY_ACTIVE_ARCH=NO -target Urho3D -configuration Release
|
2015-09-08 23:06:27 +03:00
|
|
|
endif
|
2015-09-06 18:03:47 +03:00
|
|
|
|
2015-10-20 01:08:22 +03:00
|
|
|
MakeBinDirectory:
|
|
|
|
mkdir -p $(OUTPUT_DIR)
|
|
|
|
|
2015-11-10 22:12:16 +03:00
|
|
|
libmono-urho.dylib: MakeBinDirectory libUrho3D.a vector.o binding.o glue.o events.o ApplicationProxy.o
|
|
|
|
mkdir -p $(OUTPUT_DIR) && $(CPP) -dynamiclib -g -o $(OUTPUT_DIR)/libmono-urho_$(ARCH).dylib -g $(URHO_LIBS) $(OUTPUT_DIR)/binding.o $(OUTPUT_DIR)/glue.o $(OUTPUT_DIR)/vector.o $(OUTPUT_DIR)/events.o $(OUTPUT_DIR)/ApplicationProxy.o
|
2015-09-06 18:03:47 +03:00
|
|
|
|
2015-09-14 00:33:37 +03:00
|
|
|
fat-libmono-urho.dylib:
|
2016-11-18 02:39:51 +03:00
|
|
|
make libmono-urho.dylib -f MakeiOS ARCH="i386" && make libmono-urho.dylib -f MakeiOS ARCH="x86_64" && make libmono-urho.dylib -f MakeiOS ARCH="armv7" && make libmono-urho.dylib -f MakeiOS ARCH="arm64" && cd $(OUTPUT_DIR) && lipo -create libmono-urho_i386.dylib libmono-urho_x86_64.dylib libmono-urho_armv7.dylib libmono-urho_arm64.dylib -output libmono-urho.dylib
|
2016-01-19 19:11:54 +03:00
|
|
|
|
|
|
|
Urho.framework: fat-libmono-urho.dylib
|
2016-02-29 02:35:48 +03:00
|
|
|
rm -rf $(OUTPUT_DIR)/Urho.framework && mkdir $(OUTPUT_DIR)/Urho.framework && cp Bindings/iOS/Urho.framework.plist $(OUTPUT_DIR)/Urho.framework/Info.plist && cd $(OUTPUT_DIR) && cp libmono-Urho.dylib Urho.framework/Urho && install_name_tool -id @rpath/Urho.framework/Urho Urho.framework/Urho && zip -r Urho.framework.zip Urho.framework
|
2016-01-19 19:11:54 +03:00
|
|
|
|
2015-09-09 00:24:41 +03:00
|
|
|
binding.o:
|
2016-02-29 02:35:48 +03:00
|
|
|
$(CPP) -c -o $(OUTPUT_DIR)/binding.o Bindings/Portable/Generated/binding.cpp
|
2015-09-06 18:03:47 +03:00
|
|
|
|
2015-09-09 00:24:41 +03:00
|
|
|
glue.o:
|
2016-02-29 02:35:48 +03:00
|
|
|
$(CPP) -c -o $(OUTPUT_DIR)/glue.o Bindings/Native/glue.cpp
|
2015-09-06 18:03:47 +03:00
|
|
|
|
2015-09-09 00:24:41 +03:00
|
|
|
vector.o:
|
2016-02-29 02:35:48 +03:00
|
|
|
$(CPP) -c -o $(OUTPUT_DIR)/vector.o Bindings/Native/vector.cpp
|
2015-09-06 18:03:47 +03:00
|
|
|
|
2015-09-09 00:24:41 +03:00
|
|
|
events.o:
|
2016-02-29 02:35:48 +03:00
|
|
|
$(CPP) -c -o $(OUTPUT_DIR)/events.o Bindings/Portable/Generated/events.cpp
|
2015-09-06 18:03:47 +03:00
|
|
|
|
2015-09-09 00:24:41 +03:00
|
|
|
ApplicationProxy.o:
|
2016-02-29 02:35:48 +03:00
|
|
|
$(CPP) -c -o $(OUTPUT_DIR)/ApplicationProxy.o Bindings/Native/ApplicationProxy.cpp
|
2016-01-26 16:01:21 +03:00
|
|
|
|
|
|
|
Urho.iOS.dll:
|
|
|
|
/Applications/Xamarin\ Studio.app/Contents/MacOS/mdtool -v build "--configuration:Release" -p:Urho.iOS Urho.sln
|