Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/sdks
diff options
context:
space:
mode:
authorLudovic Henry <luhenry@microsoft.com>2018-03-03 18:21:38 +0300
committerGitHub <noreply@github.com>2018-03-03 18:21:38 +0300
commit43ac34b36e2e23539b67741b480e13aed97b945c (patch)
tree758da20213375a5613672c6d10d4273cfd4012bb /sdks
parente7ba41d14c7e1dc6e860e6e9c5a3db05686d2c5a (diff)
[sdks] Unify targets to build runtimes (#7394)
* [sdks] Move common targets * [sdks] Have RELEASE be empty when CONFIGURATION != 'release' * [sdks] Create common runtime compilation template * [sdks] Use runtime template for Android * [sdks] Use runtime template for iOS
Diffstat (limited to 'sdks')
-rw-r--r--sdks/builds/.gitignore18
-rw-r--r--sdks/builds/Makefile9
-rw-r--r--sdks/builds/android.mk278
-rw-r--r--sdks/builds/ios.mk331
-rw-r--r--sdks/builds/runtime.mk83
5 files changed, 301 insertions, 418 deletions
diff --git a/sdks/builds/.gitignore b/sdks/builds/.gitignore
index 4a8f77947bd..a72cb7938df 100644
--- a/sdks/builds/.gitignore
+++ b/sdks/builds/.gitignore
@@ -16,12 +16,18 @@ android-host-Darwin-*/
android-host-Linux-*/
android-host-mxe-Win32-*/
android-host-mxe-Win64-*/
-ios-target32/
-ios-target64/
-ios-cross32/
-ios-cross64/
-ios-sim32/
-ios-sim64/
+ios-target32-*/
+ios-target32s-*/
+ios-target64-*/
+ios-targettv-*/
+ios-targetwatch-*/
+ios-cross32-*/
+ios-cross64-*/
+ios-crosswatch-*/
+ios-sim32-*/
+ios-sim64-*/
+ios-simtv-*/
+ios-simwatch-*/
wasm-interp/
bcl/
diff --git a/sdks/builds/Makefile b/sdks/builds/Makefile
index 9ba4cfe9d19..02d6cf6560b 100644
--- a/sdks/builds/Makefile
+++ b/sdks/builds/Makefile
@@ -4,7 +4,7 @@ include $(TOP)/sdks/paths.mk
CONFIGURATION?=release
-RELEASE=$(if $(filter $(CONFIGURATION),release),true,false)
+RELEASE=$(if $(filter $(CONFIGURATION),release),1)
CCACHE:=$(shell which ccache)
@@ -17,9 +17,16 @@ endif
all: package
## Common Mono targets
+
+.PHONY: configure-mono
+configure-mono: $(TOP)/configure
+
$(TOP)/configure: $(TOP)/configure.ac $(TOP)/autogen.sh
cd $(TOP) && PATH=$(EXTRA_PATH):$$PATH NOCONFIGURE=1 ./autogen.sh
+$(TOP)/tools/offsets-tool/MonoAotOffsetsDumper.exe: $(wildcard $(TOP)/tools/offsets-tool/*.cs)
+ $(MAKE) -C $(dir $@) MonoAotOffsetsDumper.exe
+
TARGETS=
## MXE targets
diff --git a/sdks/builds/android.mk b/sdks/builds/android.mk
index b989d18d6d5..59b8009bbcc 100644
--- a/sdks/builds/android.mk
+++ b/sdks/builds/android.mk
@@ -7,64 +7,46 @@
# $(4): host_triple
#
# Flags:
-# android_$(1)_CFLAGS
-# android_$(1)_CXXFLAGS
-# android_$(1)_LDFLAGS
+# android-$(1)_CFLAGS
+# android-$(1)_CXXFLAGS
+# android-$(1)_LDFLAGS
define AndroidTargetTemplate
-_android_$(1)_AR=$$(TOP)/sdks/builds/toolchains/android-$(1)/bin/$(3)-ar
-_android_$(1)_AS=$$(TOP)/sdks/builds/toolchains/android-$(1)/bin/$(3)-as
-_android_$(1)_CC=$$(CCACHE) $$(TOP)/sdks/builds/toolchains/android-$(1)/bin/$(3)-clang
-_android_$(1)_CXX=$$(CCACHE) $$(TOP)/sdks/builds/toolchains/android-$(1)/bin/$(3)-clang++
-_android_$(1)_CPP=$$(CCACHE) $$(TOP)/sdks/builds/toolchains/android-$(1)/bin/$(3)-cpp -I$$(TOP)/sdks/builds/toolchains/android-$(1)/usr/include
-_android_$(1)_CXXCPP=$$(CCACHE) $$(TOP)/sdks/builds/toolchains/android-$(1)/bin/$(3)-cpp -I$$(TOP)/sdks/builds/toolchains/android-$(1)/usr/include
-_android_$(1)_DLLTOOL=
-_android_$(1)_LD=$$(TOP)/sdks/builds/toolchains/android-$(1)/bin/$(3)-ld
-_android_$(1)_OBJDUMP="$$(TOP)/sdks/builds/toolchains/android-$(1)/bin/$(3)-objdump"
-_android_$(1)_RANLIB=$$(TOP)/sdks/builds/toolchains/android-$(1)/bin/$(3)-ranlib
-_android_$(1)_STRIP=$$(TOP)/sdks/builds/toolchains/android-$(1)/bin/$(3)-strip
-
-_android_$(1)_AC_VARS= \
+_android-$(1)_AR=$$(TOP)/sdks/builds/toolchains/android-$(1)/bin/$(3)-ar
+_android-$(1)_AS=$$(TOP)/sdks/builds/toolchains/android-$(1)/bin/$(3)-as
+_android-$(1)_CC=$$(CCACHE) $$(TOP)/sdks/builds/toolchains/android-$(1)/bin/$(3)-clang
+_android-$(1)_CXX=$$(CCACHE) $$(TOP)/sdks/builds/toolchains/android-$(1)/bin/$(3)-clang++
+_android-$(1)_CPP=$$(CCACHE) $$(TOP)/sdks/builds/toolchains/android-$(1)/bin/$(3)-cpp -I$$(TOP)/sdks/builds/toolchains/android-$(1)/usr/include
+_android-$(1)_CXXCPP=$$(CCACHE) $$(TOP)/sdks/builds/toolchains/android-$(1)/bin/$(3)-cpp -I$$(TOP)/sdks/builds/toolchains/android-$(1)/usr/include
+_android-$(1)_DLLTOOL=
+_android-$(1)_LD=$$(TOP)/sdks/builds/toolchains/android-$(1)/bin/$(3)-ld
+_android-$(1)_OBJDUMP="$$(TOP)/sdks/builds/toolchains/android-$(1)/bin/$(3)-objdump"
+_android-$(1)_RANLIB=$$(TOP)/sdks/builds/toolchains/android-$(1)/bin/$(3)-ranlib
+_android-$(1)_STRIP=$$(TOP)/sdks/builds/toolchains/android-$(1)/bin/$(3)-strip
+
+_android-$(1)_AC_VARS= \
mono_cv_uscore=yes \
ac_cv_func_sched_getaffinity=no \
ac_cv_func_sched_setaffinity=no
-_android_$(1)_CFLAGS= \
- $(if $(filter $(RELEASE),true),-O2 -g,-O0 -ggdb3 -fno-omit-frame-pointer) \
+_android-$(1)_CFLAGS= \
-fstack-protector \
-DMONODROID=1 \
- $$(android_$(1)_CFLAGS)
+ $$(android-$(1)_CFLAGS)
-_android_$(1)_CXXFLAGS= \
- $(if $(filter $(RELEASE),true),-O2 -g,-O0 -ggdb3 -fno-omit-frame-pointer) \
+_android-$(1)_CXXFLAGS= \
-fstack-protector \
-DMONODROID=1 \
- $$(android_$(1)_CXXFLAGS)
+ $$(android-$(1)_CXXFLAGS)
-_android_$(1)_LDFLAGS= \
+_android-$(1)_LDFLAGS= \
-z now -z relro -z noexecstack \
-ldl -lm -llog -lc -lgcc \
-Wl,-rpath-link=$$(NDK_DIR)/platforms/android-$$(ANDROID_PLATFORM_VERSION_$(1))/arch-$(2)/usr/lib,-dynamic-linker=/system/bin/linker \
-L$$(NDK_DIR)/platforms/android-$$(ANDROID_PLATFORM_VERSION_$(1))/arch-$(2)/usr/lib \
- $$(android_$(1)_LDFLAGS)
-
-_android_$(1)_CONFIGURE_ENVIRONMENT = \
- AR="$$(_android_$(1)_AR)" \
- AS="$$(_android_$(1)_AS)" \
- CC="$$(_android_$(1)_CC)" \
- CFLAGS="$$(_android_$(1)_CFLAGS)" \
- CXX="$$(_android_$(1)_CXX)" \
- CXXFLAGS="$$(_android_$(1)_CXXFLAGS) " \
- CPP="$$(_android_$(1)_CPP) $$(_android_$(1)_CPPFLAGS)" \
- CXXCPP="$$(_android_$(1)_CXXCPP)" \
- DLLTOOL="$$(_android_$(1)_DLLTOOL)" \
- LD="$$(_android_$(1)_LD)" \
- LDFLAGS="$$(_android_$(1)_LDFLAGS)" \
- OBJDUMP="$$(_android_$(1)_OBJDUMP)" \
- STRIP="$$(_android_$(1)_STRIP)" \
- RANLIB="$$(_android_$(1)_RANLIB)"
-
-_android_$(1)_CONFIGURE_FLAGS= \
+ $$(android-$(1)_LDFLAGS)
+
+_android-$(1)_CONFIGURE_FLAGS= \
--host=$(4) \
--cache-file=$$(TOP)/sdks/builds/android-$(1)-$$(CONFIGURATION).config.cache \
--prefix=$$(TOP)/sdks/out/android-$(1)-$$(CONFIGURATION) \
@@ -85,66 +67,37 @@ _android_$(1)_CONFIGURE_FLAGS= \
python "$$(NDK_DIR)/build/tools/make_standalone_toolchain.py" --verbose --force --api=$$(ANDROID_PLATFORM_VERSION_$(1)) --arch=$(2) --install-dir=$$(TOP)/sdks/builds/toolchains/android-$(1)
touch $$@
-.stamp-android-$(1)-$$(CONFIGURATION)-configure: $$(TOP)/configure .stamp-android-$(1)-toolchain
- mkdir -p $$(TOP)/sdks/builds/android-$(1)-$$(CONFIGURATION)
- cd $$(TOP)/sdks/builds/android-$(1)-$$(CONFIGURATION) && $$(TOP)/configure $$(_android_$(1)_AC_VARS) $$(_android_$(1)_CONFIGURE_ENVIRONMENT) $$(_android_$(1)_CONFIGURE_FLAGS)
- touch $$@
-
-.PHONY: .stamp-android-$(1)-configure
-.stamp-android-$(1)-configure: .stamp-android-$(1)-$$(CONFIGURATION)-configure
-
-.PHONY: build-custom-android-$(1)
-build-custom-android-$(1):
- $$(MAKE) -C android-$(1)-$$(CONFIGURATION)
-
-.PHONY: setup-custom-android-$(1)
-setup-custom-android-$(1):
- mkdir -p $$(TOP)/sdks/out/android-$(1)-$$(CONFIGURATION)
-
.PHONY: package-android-$(1)-$$(CONFIGURATION)
-package-android-$(1)-$$(CONFIGURATION):
- $$(MAKE) -C $$(TOP)/sdks/builds/android-$(1)-$$(CONFIGURATION)/mono install
+package-android-$(1)-$$(CONFIGURATION)::
$$(MAKE) -C $$(TOP)/sdks/builds/android-$(1)-$$(CONFIGURATION)/support install
-.PHONY: package-android-$(1)
-package-android-$(1):
- $$(MAKE) package-android-$(1)-$$(CONFIGURATION)
-
-.PHONY: clean-android-$(1)-$$(CONFIGURATION)
-clean-android-$(1)-$$(CONFIGURATION):
- rm -rf .stamp-android-$(1)-toolchain .stamp-android-$(1)-$$(CONFIGURATION)-configure $$(TOP)/sdks/builds/toolchains/android-$(1) $$(TOP)/sdks/builds/android-$(1)-$$(CONFIGURATION) $$(TOP)/sdks/builds/android-$(1)-$$(CONFIGURATION).config.cache $$(TOP)/sdks/out/android-$(1)-$$(CONFIGURATION)
-
-.PHONY: clean-android-$(1)
-clean-android-$(1):
- $$(MAKE) clean-android-$(1)-$$(CONFIGURATION)
-
-TARGETS += android-$(1)
+$$(eval $$(call RuntimeTemplate,android-$(1)))
endef
## android-armeabi
-android_armeabi_CFLAGS=-D__POSIX_VISIBLE=201002 -DSK_RELEASE -DNDEBUG -UDEBUG -fpic -march=armv5te
-android_armeabi_CXXFLAGS=-D__POSIX_VISIBLE=201002 -DSK_RELEASE -DNDEBUG -UDEBUG -fpic -march=armv5te
-android_armeabi_LDFLAGS=-Wl,--fix-cortex-a8
+android-armeabi_CFLAGS=-D__POSIX_VISIBLE=201002 -DSK_RELEASE -DNDEBUG -UDEBUG -fpic -march=armv5te
+android-armeabi_CXXFLAGS=-D__POSIX_VISIBLE=201002 -DSK_RELEASE -DNDEBUG -UDEBUG -fpic -march=armv5te
+android-armeabi_LDFLAGS=-Wl,--fix-cortex-a8
$(eval $(call AndroidTargetTemplate,armeabi,arm,arm-linux-androideabi,armv5-linux-androideabi))
## android-armeabi-v7a
-android_armeabi-v7a_CFLAGS=-D__POSIX_VISIBLE=201002 -DSK_RELEASE -DNDEBUG -UDEBUG -fpic -march=armv7-a -mtune=cortex-a8 -mfpu=vfp -mfloat-abi=softfp
-android_armeabi-v7a_CXXFLAGS=-D__POSIX_VISIBLE=201002 -DSK_RELEASE -DNDEBUG -UDEBUG -fpic -march=armv7-a -mtune=cortex-a8 -mfpu=vfp -mfloat-abi=softfp
-android_armeabi-v7a_LDFLAGS=-Wl,--fix-cortex-a8
+android-armeabi-v7a_CFLAGS=-D__POSIX_VISIBLE=201002 -DSK_RELEASE -DNDEBUG -UDEBUG -fpic -march=armv7-a -mtune=cortex-a8 -mfpu=vfp -mfloat-abi=softfp
+android-armeabi-v7a_CXXFLAGS=-D__POSIX_VISIBLE=201002 -DSK_RELEASE -DNDEBUG -UDEBUG -fpic -march=armv7-a -mtune=cortex-a8 -mfpu=vfp -mfloat-abi=softfp
+android-armeabi-v7a_LDFLAGS=-Wl,--fix-cortex-a8
$(eval $(call AndroidTargetTemplate,armeabi-v7a,arm,arm-linux-androideabi,armv5-linux-androideabi))
## android-arm64-v8a
-android_arm64-v8a_CFLAGS=-D__POSIX_VISIBLE=201002 -DSK_RELEASE -DNDEBUG -UDEBUG -fpic -DL_cuserid=9 -DANDROID64
-android_arm64-v8a_CXXFLAGS=-D__POSIX_VISIBLE=201002 -DSK_RELEASE -DNDEBUG -UDEBUG -fpic -DL_cuserid=9 -DANDROID64
+android-arm64-v8a_CFLAGS=-D__POSIX_VISIBLE=201002 -DSK_RELEASE -DNDEBUG -UDEBUG -fpic -DL_cuserid=9 -DANDROID64
+android-arm64-v8a_CXXFLAGS=-D__POSIX_VISIBLE=201002 -DSK_RELEASE -DNDEBUG -UDEBUG -fpic -DL_cuserid=9 -DANDROID64
$(eval $(call AndroidTargetTemplate,arm64-v8a,arm64,aarch64-linux-android,aarch64-linux-android))
## android-x86
$(eval $(call AndroidTargetTemplate,x86,x86,i686-linux-android,i686-linux-android))
## android-x86_64
-android_x86_64_CFLAGS=-DL_cuserid=9
-android_x86_64_CXXFLAGS=-DL_cuserid=9
+android-x86_64_CFLAGS=-DL_cuserid=9
+android-x86_64_CXXFLAGS=-DL_cuserid=9
$(eval $(call AndroidTargetTemplate,x86_64,x86_64,x86_64-linux-android,x86_64-linux-android))
##
@@ -152,43 +105,23 @@ $(eval $(call AndroidTargetTemplate,x86_64,x86_64,x86_64-linux-android,x86_64-li
# $(1): target
#
# Flags:
-# android_$(1)_CFLAGS
-# android_$(1)_CXXFLAGS
-#
-# Notes:
-# XA doesn't seem to build differently for Darwin and Linux, seems like a bug on their end
+# android-$(1)_CFLAGS
+# android-$(1)_CXXFLAGS
define AndroidHostTemplate
-_android_$(1)_AR=ar
-_android_$(1)_AS=as
-_android_$(1)_CC=cc
-_android_$(1)_CXX=c++
-_android_$(1)_CXXCPP=cpp
-_android_$(1)_LD=ld
-_android_$(1)_RANLIB=ranlib
-_android_$(1)_STRIP=strip
-
-_android_$(1)_CFLAGS= \
- $(if $(filter $(RELEASE),true),-O2 -g,-O0 -ggdb3 -fno-omit-frame-pointer) \
- $$(android_$(1)_CFLAGS)
-
-_android_$(1)_CXXFLAGS= \
- $(if $(filter $(RELEASE),true),-O2 -g,-O0 -ggdb3 -fno-omit-frame-pointer) \
- $$(android_$(1)_CXXFLAGS)
-
-_android_$(1)_CONFIGURE_ENVIRONMENT= \
- AR="$$(_android_$(1)_AR)" \
- AS="$$(_android_$(1)_AS)" \
- CC="$$(_android_$(1)_CC)" \
- CFLAGS="$$(_android_$(1)_CFLAGS)" \
- CXX="$$(_android_$(1)_CXX)" \
- CXXFLAGS="$$(_android_$(1)_CXXFLAGS)" \
- CXXCPP="$$(_android_$(1)_CXXCPP)" \
- LD="$$(_android_$(1)_LD)" \
- RANLIB="$$(_android_$(1)_RANLIB)" \
- STRIP="$$(_android_$(1)_STRIP)"
-
-_android_$(1)_CONFIGURE_FLAGS= \
+_android-$(1)_AR=ar
+_android-$(1)_AS=as
+_android-$(1)_CC=cc
+_android-$(1)_CXX=c++
+_android-$(1)_CXXCPP=cpp
+_android-$(1)_LD=ld
+_android-$(1)_RANLIB=ranlib
+_android-$(1)_STRIP=strip
+
+_android-$(1)_CFLAGS=$$(android-$(1)_CFLAGS)
+_android-$(1)_CXXFLAGS=$$(android-$(1)_CXXFLAGS)
+
+_android-$(1)_CONFIGURE_FLAGS= \
--cache-file=$$(TOP)/sdks/builds/android-$(1)-$$(CONFIGURATION).config.cache \
--prefix=$$(TOP)/sdks/out/android-$(1)-$$(CONFIGURATION) \
--disable-boehm \
@@ -205,44 +138,15 @@ _android_$(1)_CONFIGURE_FLAGS= \
.stamp-android-$(1)-toolchain:
touch $$@
-.stamp-android-$(1)-$$(CONFIGURATION)-configure: $$(TOP)/configure .stamp-android-$(1)-toolchain
- mkdir -p $$(TOP)/sdks/builds/android-$(1)-$$(CONFIGURATION)
- cd $$(TOP)/sdks/builds/android-$(1)-$$(CONFIGURATION) && $$< $$(_android_$(1)_CONFIGURE_ENVIRONMENT) $$(_android_$(1)_CONFIGURE_FLAGS)
- touch $$@
-
-.PHONY: .stamp-android-$(1)-configure
-.stamp-android-$(1)-configure: .stamp-android-$(1)-$$(CONFIGURATION)-configure
-
-.PHONY: build-custom-android-$(1)
-build-custom-android-$(1):
- $$(MAKE) -C android-$(1)-$$(CONFIGURATION)
-
-.PHONY: setup-custom-android-$(1)
-setup-custom-android-$(1):
- mkdir -p $$(TOP)/sdks/out/android-$(1)-$$(CONFIGURATION)
-
.PHONY: package-android-$(1)-$$(CONFIGURATION)
-package-android-$(1)-$$(CONFIGURATION):
- $$(MAKE) -C $$(TOP)/sdks/builds/android-$(1)-$$(CONFIGURATION)/mono install
+package-android-$(1)-$$(CONFIGURATION)::
$$(MAKE) -C $$(TOP)/sdks/builds/android-$(1)-$$(CONFIGURATION)/support install
-.PHONY: package-android-$(1)
-package-android-$(1):
- $$(MAKE) package-android-$(1)-$$(CONFIGURATION)
-
-.PHONY: clean-android-$(1)-$$(CONFIGURATION)
-clean-android-$(1)-$$(CONFIGURATION):
- rm -rf .stamp-android-$(1)-toolchain .stamp-android-$(1)-$$(CONFIGURATION)-configure $$(TOP)/sdks/builds/android-$(1)-$$(CONFIGURATION) $$(TOP)/sdks/builds/android-$(1)-$$(CONFIGURATION).config.cache $$(TOP)/sdks/out/android-$(1)-$$(CONFIGURATION)
-
-.PHONY: clean-android-$(1)
-clean-android-$(1):
- $$(MAKE) clean-android-$(1)-$$(CONFIGURATION)
-
-TARGETS += android-$(1)
+$$(eval $$(call RuntimeTemplate,android-$(1)))
endef
-android_host-Darwin_CFLAGS=-mmacosx-version-min=10.9
+android-host-Darwin_CFLAGS=-mmacosx-version-min=10.9
$(eval $(call AndroidHostTemplate,host-Darwin))
$(eval $(call AndroidHostTemplate,host-Linux))
@@ -252,42 +156,29 @@ $(eval $(call AndroidHostTemplate,host-Linux))
# $(2): arch
define AndroidHostMxeTemplate
-_android_$(1)_PATH=$$(TOP)/sdks/out/mxe/bin
+_android-$(1)_PATH=$$(TOP)/sdks/out/mxe/bin
-_android_$(1)_AR=$$(TOP)/sdks/out/mxe/bin/$(2)-w64-mingw32.static-ar
-_android_$(1)_AS=$$(TOP)/sdks/out/mxe/bin/$(2)-w64-mingw32.static-as
-_android_$(1)_CC=$$(TOP)/sdks/out/mxe/bin/$(2)-w64-mingw32.static-gcc
-_android_$(1)_CXX=$$(TOP)/sdks/out/mxe/bin/$(2)-w64-mingw32.static-g++
-_android_$(1)_DLLTOOL=$$(TOP)/sdks/out/mxe/bin/$(2)-w64-mingw32.static-dlltool
-_android_$(1)_LD=$$(TOP)/sdks/out/mxe/bin/$(2)-w64-mingw32.static-ld
-_android_$(1)_OBJDUMP=$$(TOP)/sdks/out/mxe/bin/$(2)-w64-mingw32.static-objdump
-_android_$(1)_RANLIB=$$(TOP)/sdks/out/mxe/bin/$(2)-w64-mingw32.static-ranlib
-_android_$(1)_STRIP=$$(TOP)/sdks/out/mxe/bin/$(2)-w64-mingw32.static-strip
+_android-$(1)_AR=$$(TOP)/sdks/out/mxe/bin/$(2)-w64-mingw32.static-ar
+_android-$(1)_AS=$$(TOP)/sdks/out/mxe/bin/$(2)-w64-mingw32.static-as
+_android-$(1)_CC=$$(TOP)/sdks/out/mxe/bin/$(2)-w64-mingw32.static-gcc
+_android-$(1)_CXX=$$(TOP)/sdks/out/mxe/bin/$(2)-w64-mingw32.static-g++
+_android-$(1)_DLLTOOL=$$(TOP)/sdks/out/mxe/bin/$(2)-w64-mingw32.static-dlltool
+_android-$(1)_LD=$$(TOP)/sdks/out/mxe/bin/$(2)-w64-mingw32.static-ld
+_android-$(1)_OBJDUMP=$$(TOP)/sdks/out/mxe/bin/$(2)-w64-mingw32.static-objdump
+_android-$(1)_RANLIB=$$(TOP)/sdks/out/mxe/bin/$(2)-w64-mingw32.static-ranlib
+_android-$(1)_STRIP=$$(TOP)/sdks/out/mxe/bin/$(2)-w64-mingw32.static-strip
-_android_$(1)_AC_VARS= \
+_android-$(1)_AC_VARS= \
ac_cv_header_zlib_h=no \
ac_cv_search_dlopen=no
-_android_$(1)_CFLAGS= \
- $(if $(filter $(RELEASE),true),-O2 -g,-O0 -ggdb3 -fno-omit-frame-pointer) \
+_android-$(1)_CFLAGS= \
-DXAMARIN_PRODUCT_VERSION=0
-_android_$(1)_CXXFLAGS= \
- $(if $(filter $(RELEASE),true),-O2 -g,-O0 -ggdb3 -fno-omit-frame-pointer) \
+_android-$(1)_CXXFLAGS= \
-DXAMARIN_PRODUCT_VERSION=0
-_android_$(1)_CONFIGURE_ENVIRONMENT= \
- AR="$$(_android_$(1)_AR)" \
- AS="$$(_android_$(1)_AS)" \
- CC="$$(_android_$(1)_CC)" \
- CFLAGS="$$(_android_$(1)_CFLAGS)" \
- CXX="$$(_android_$(1)_CXX)" \
- CXXFLAGS="$$(_android_$(1)_CXXFLAGS)" \
- LD="$$(_android_$(1)_LD)" \
- RANLIB="$$(_android_$(1)_RANLIB)" \
- STRIP="$$(_android_$(1)_STRIP)"
-
-_android_$(1)_CONFIGURE_FLAGS= \
+_android-$(1)_CONFIGURE_FLAGS= \
--host=$(2)-w64-mingw32.static \
--target=$(2)-w64-mingw32.static \
--cache-file=$$(TOP)/sdks/builds/android-$(1)-$$(CONFIGURATION).config.cache \
@@ -302,40 +193,13 @@ _android_$(1)_CONFIGURE_FLAGS= \
.stamp-android-$(1)-toolchain:
touch $$@
-.stamp-android-$(1)-$$(CONFIGURATION)-configure: $$(TOP)/configure .stamp-android-$(1)-toolchain | package-mxe
- mkdir -p $$(TOP)/sdks/builds/android-$(1)-$$(CONFIGURATION)
- cd $$(TOP)/sdks/builds/android-$(1)-$$(CONFIGURATION) && PATH="$$$$PATH:$$(_android_$(1)_PATH)" $$< $$(_android_$(1)_AC_VARS) $$(_android_$(1)_CONFIGURE_ENVIRONMENT) $$(_android_$(1)_CONFIGURE_FLAGS)
- touch $$@
-
-.PHONY: .stamp-android-$(1)-configure
-.stamp-android-$(1)-configure: .stamp-android-$(1)-$$(CONFIGURATION)-configure
-
-.PHONY: build-custom-android-$(1)
-build-custom-android-$(1):
- $$(MAKE) -C android-$(1)-$$(CONFIGURATION)
-
-.PHONY: setup-custom-android-$(1)
-setup-custom-android-$(1):
- mkdir -p $$(TOP)/sdks/out/android-$(1)-$$(CONFIGURATION)
+.stamp-android-$(1)-$$(CONFIGURATION)-configure: | package-mxe
.PHONY: package-android-$(1)-$$(CONFIGURATION)
-package-android-$(1)-$$(CONFIGURATION):
- $$(MAKE) -C $$(TOP)/sdks/builds/android-$(1)-$$(CONFIGURATION)/mono install
+package-android-$(1)-$$(CONFIGURATION)::
$$(MAKE) -C $$(TOP)/sdks/builds/android-$(1)-$$(CONFIGURATION)/support install
-.PHONY: package-android-$(1)
-package-android-$(1):
- $$(MAKE) package-android-$(1)-$$(CONFIGURATION)
-
-.PHONY: clean-android-$(1)-$$(CONFIGURATION)
-clean-android-$(1)-$$(CONFIGURATION):
- rm -rf .stamp-android-$(1)-toolchain .stamp-android-$(1)-$$(CONFIGURATION)-configure $$(TOP)/sdks/builds/android-$(1)-$$(CONFIGURATION) $$(TOP)/sdks/builds/android-$(1)-$$(CONFIGURATION).config.cache $$(TOP)/sdks/out/android-$(1)-$$(CONFIGURATION)
-
-.PHONY: clean-android-$(1)
-clean-android-$(1):
- $$(MAKE) clean-android-$(1)-$$(CONFIGURATION)
-
-TARGETS += android-$(1)
+$$(eval $$(call RuntimeTemplate,android-$(1)))
endef
diff --git a/sdks/builds/ios.mk b/sdks/builds/ios.mk
index 6d57085e814..23043375adc 100644
--- a/sdks/builds/ios.mk
+++ b/sdks/builds/ios.mk
@@ -1,3 +1,6 @@
+
+include runtime.mk
+
#
# Targets:
# - build-ios-<target>
@@ -11,15 +14,7 @@
PLATFORM_BIN=$(XCODE_DIR)/Toolchains/XcodeDefault.xctoolchain/usr/bin
-ios_CFLAGS= \
- $(if $(filter $(RELEASE),true),-O2,-O0 -ggdb3 -gdwarf-2)
-
-ios_CPPFLAGS= \
- $(if $(filter $(RELEASE),true),-O2,-O0 -ggdb3 -gdwarf-2) \
- -DMONOTOUCH=1
-
-ios_CXXFLAGS= \
- $(if $(filter $(RELEASE),true),-O2,-O0 -ggdb3 -gdwarf-2)
+ios_CPPFLAGS=-DMONOTOUCH=1
ios_LDFLAGS=
@@ -38,23 +33,23 @@ BITCODE_CONFIGURE_FLAGS=--enable-llvm-runtime --with-bitcode=yes
# $(3): arch (arm or aarch64)
#
# Flags:
-# ios_$(1)_AC_VARS
-# ios_$(1)_SYSROOT
-# ios_$(1)_CONFIGURE_FLAGS
-# ios_$(1)_CFLAGS
-# ios_$(1)_CPPFLAGS
-# ios_$(1)_CXXFLAGS
-# ios_$(1)_LDFLAGS
-# ios_$(1)_BITCODE_MARKER
+# ios-$(1)_AC_VARS
+# ios-$(1)_SYSROOT
+# ios-$(1)_CONFIGURE_FLAGS
+# ios-$(1)_CFLAGS
+# ios-$(1)_CPPFLAGS
+# ios-$(1)_CXXFLAGS
+# ios-$(1)_LDFLAGS
+# ios-$(1)_BITCODE_MARKER
#
# This handles tvos/watchos as well.
#
define iOSDeviceTemplate
-_ios_$(1)_CC=$$(CCACHE) $$(PLATFORM_BIN)/clang
-_ios_$(1)_CXX=$$(CCACHE) $$(PLATFORM_BIN)/clang++
+_ios-$(1)_CC=$$(CCACHE) $$(PLATFORM_BIN)/clang
+_ios-$(1)_CXX=$$(CCACHE) $$(PLATFORM_BIN)/clang++
-_ios_$(1)_AC_VARS= \
+_ios-$(1)_AC_VARS= \
ac_cv_c_bigendian=no \
ac_cv_func_finite=no \
ac_cv_func_getpwuid_r=no \
@@ -67,53 +62,43 @@ _ios_$(1)_AC_VARS= \
ac_cv_func_utimensat=no \
mono_cv_sizeof_sunpath=104 \
mono_cv_uscore=yes \
- $$(ios_$(1)_AC_VARS)
+ $$(ios-$(1)_AC_VARS)
-_ios_$(1)_CFLAGS= \
- $$(ios_CFLAGS) \
- $$(ios_$(1)_SYSROOT) \
+_ios-$(1)_CFLAGS= \
+ $$(ios-$(1)_SYSROOT) \
-arch $(2) \
-Wl,-application_extension \
-fexceptions \
- $$(ios_$(1)_BITCODE_MARKER) \
- $$(ios_$(1)_CFLAGS)
+ $$(ios-$(1)_BITCODE_MARKER) \
+ $$(ios-$(1)_CFLAGS)
-_ios_$(1)_CXXFLAGS= \
- $$(ios_CXXFLAGS) \
- $$(ios_$(1)_SYSROOT) \
+_ios-$(1)_CXXFLAGS= \
+ $$(ios-$(1)_SYSROOT) \
-arch $(2) \
-Wl,-application_extension \
- $$(ios_$(1)_CXXFLAGS) \
- $$(ios_$(1)_BITCODE_MARKER)
+ $$(ios-$(1)_CXXFLAGS) \
+ $$(ios-$(1)_BITCODE_MARKER)
-_ios_$(1)_CPPFLAGS= \
+_ios-$(1)_CPPFLAGS= \
$$(ios_CPPFLAGS) \
- $$(ios_$(1)_SYSROOT) \
+ $$(ios-$(1)_SYSROOT) \
-arch $(2) \
-DSMALL_CONFIG -DDISABLE_POLICY_EVIDENCE=1 -DDISABLE_PROCESS_HANDLING=1 -D_XOPEN_SOURCE -DHOST_IOS -DHAVE_LARGE_FILE_SUPPORT=1 \
- $$(ios_$(1)_CPPFLAGS)
+ $$(ios-$(1)_CPPFLAGS)
-_ios_$(1)_LDFLAGS= \
+_ios-$(1)_LDFLAGS= \
$$(ios_LDFLAGS) \
-Wl,-no_weak_imports \
-arch $(2) \
-framework CoreFoundation \
-lobjc -lc++ \
- $$(ios_$(1)_LDFLAGS)
-
-_ios_$(1)_CONFIGURE_ENVIRONMENT = \
- CC="$$(_ios_$(1)_CC)" \
- CXX="$$(_ios_$(1)_CXX)" \
- CFLAGS="$$(_ios_$(1)_CFLAGS)" \
- CPPFLAGS="$$(_ios_$(1)_CPPFLAGS)" \
- CXXFLAGS="$$(_ios_$(1)_CXXFLAGS)" \
- LDFLAGS="$$(_ios_$(1)_LDFLAGS)"
+ $$(ios-$(1)_LDFLAGS)
-_ios_$(1)_CONFIGURE_FLAGS = \
+_ios-$(1)_CONFIGURE_FLAGS = \
--build=i386-apple-darwin10 \
--host=$(3)-apple-darwin10 \
- --cache-file=$(TOP)/sdks/builds/ios-$(1).config.cache \
- --prefix=$(TOP)/sdks/out/ios-$(1) \
+ --cache-file=$(TOP)/sdks/builds/ios-$(1)-$$(CONFIGURATION).config.cache \
+ --prefix=$(TOP)/sdks/out/ios-$(1)-$$(CONFIGURATION) \
--disable-boehm \
--disable-btls \
--disable-executables \
@@ -132,25 +117,12 @@ _ios_$(1)_CONFIGURE_FLAGS = \
--with-tls=pthread \
--without-ikvm-native \
--without-sigaltstack \
- $$(ios_$(1)_CONFIGURE_FLAGS)
+ $$(ios-$(1)_CONFIGURE_FLAGS)
.stamp-ios-$(1)-toolchain:
touch $$@
-.stamp-ios-$(1)-configure: $$(TOP)/configure
- mkdir -p $$(TOP)/sdks/builds/ios-$(1)
- cd $$(TOP)/sdks/builds/ios-$(1) && PATH="$$(PLATFORM_BIN):$$$$PATH" $$(TOP)/configure $$(_ios_$(1)_AC_VARS) $$(_ios_$(1)_CONFIGURE_ENVIRONMENT) $$(_ios_$(1)_CONFIGURE_FLAGS)
- touch $$@
-
-.PHONY: package-ios-$(1)
-package-ios-$(1):
- $(MAKE) -C $$(TOP)/sdks/builds/ios-$(1)/mono install
-
-.PHONY: clean-ios-$(1)
-clean-ios-$(1):
- rm -rf .stamp-ios-$(1)-toolchain .stamp-ios-$(1)-configure $$(TOP)/sdks/builds/ios-$(1) $$(TOP)/sdks/builds/ios-$(1).config.cache $$(TOP)/sdks/out/ios-$(1)
-
-TARGETS += ios-$(1)
+$$(eval $$(call RuntimeTemplate,ios-$(1)))
endef
@@ -159,30 +131,30 @@ tvos_sysroot = -isysroot $(XCODE_DIR)/Platforms/AppleTVOS.platform/Developer/SDK
watchos_sysroot = -isysroot $(XCODE_DIR)/Platforms/WatchOS.platform/Developer/SDKs/WatchOS$(WATCH_VERSION).sdk -mwatchos-version-min=$(WATCHOS_VERSION_MIN)
# explicitly disable dtrace, since it requires inline assembly, which is disabled on AppleTV (and mono's configure.ac doesn't know that (yet at least))
-ios_targettv_CONFIGURE_FLAGS = --enable-dtrace=no $(BITCODE_CONFIGURE_FLAGS)
-ios_targetwatch_CONFIGURE_FLAGS = --with-cooperative-gc=yes $(BITCODE_CONFIGURE_FLAGS)
-
-ios_target32_SYSROOT = $(ios_sysroot)
-ios_target32s_SYSROOT = $(ios_sysroot)
-ios_target64_SYSROOT = $(ios_sysroot)
-ios_targettv_SYSROOT = $(tvos_sysroot)
-ios_targetwatch_SYSROOT = $(watchos_sysroot)
-
-ios_target32_CPPFLAGS = -DHOST_IOS
-ios_target32s_CPPFLAGS = -DHOST_IOS
-ios_target64_CPPFLAGS = -DHOST_IOS
-ios_targettv_CPPFLAGS = -DHOST_APPLETVOS -DTARGET_APPLETVOS
-ios_targetwatch_CPPFLAGS = -DHOST_IOS -DHOST_WATCHOS
-
-ios_targettv_CFLAGS = -fembed-bitcode -fno-gnu-inline-asm
-ios_targettv_CXXFLAGS = -fembed-bitcode -fno-gnu-inline-asm
-ios_targetwatch_CFLAGS = -fembed-bitcode -fno-gnu-inline-asm
-ios_targetwatch_CXXFLAGS = -fembed-bitcode -fno-gnu-inline-asm
-
-ios_targettv_LDFLAGS = -Wl,-bitcode_bundle $(BITCODE_LDFLAGS)
-ios_targetwatch_LDFLAGS = -Wl,-bitcode_bundle $(BITCODE_LDFLAGS)
-
-ios_targettv_AC_VARS = \
+ios-targettv_CONFIGURE_FLAGS = --enable-dtrace=no $(BITCODE_CONFIGURE_FLAGS)
+ios-targetwatch_CONFIGURE_FLAGS = --with-cooperative-gc=yes $(BITCODE_CONFIGURE_FLAGS)
+
+ios-target32_SYSROOT = $(ios_sysroot)
+ios-target32s_SYSROOT = $(ios_sysroot)
+ios-target64_SYSROOT = $(ios_sysroot)
+ios-targettv_SYSROOT = $(tvos_sysroot)
+ios-targetwatch_SYSROOT = $(watchos_sysroot)
+
+ios-target32_CPPFLAGS = -DHOST_IOS
+ios-target32s_CPPFLAGS = -DHOST_IOS
+ios-target64_CPPFLAGS = -DHOST_IOS
+ios-targettv_CPPFLAGS = -DHOST_APPLETVOS -DTARGET_APPLETVOS
+ios-targetwatch_CPPFLAGS = -DHOST_IOS -DHOST_WATCHOS
+
+ios-targettv_CFLAGS = -fembed-bitcode -fno-gnu-inline-asm
+ios-targettv_CXXFLAGS = -fembed-bitcode -fno-gnu-inline-asm
+ios-targetwatch_CFLAGS = -fembed-bitcode -fno-gnu-inline-asm
+ios-targetwatch_CXXFLAGS = -fembed-bitcode -fno-gnu-inline-asm
+
+ios-targettv_LDFLAGS = -Wl,-bitcode_bundle $(BITCODE_LDFLAGS)
+ios-targetwatch_LDFLAGS = -Wl,-bitcode_bundle $(BITCODE_LDFLAGS)
+
+ios-targettv_AC_VARS = \
ac_cv_func_system=no \
ac_cv_func_pthread_kill=no \
ac_cv_func_kill=no \
@@ -192,12 +164,12 @@ ios_targettv_AC_VARS = \
ac_cv_func_execve=no \
ac_cv_func_execvp=no \
ac_cv_func_signal=no
-ios_targetwatch_AC_VARS = $(ios_targettv_AC_VARS)
+ios-targetwatch_AC_VARS = $(ios-targettv_AC_VARS)
-# ios_target32_BITCODE_MARKER=-fembed-bitcode-marker
+# ios-target32_BITCODE_MARKER=-fembed-bitcode-marker
$(eval $(call iOSDeviceTemplate,target32,armv7,arm))
$(eval $(call iOSDeviceTemplate,target32s,armv7s,arm))
-# ios_target64_BITCODE_MARKER=-fembed-bitcode-marker
+# ios-target64_BITCODE_MARKER=-fembed-bitcode-marker
$(eval $(call iOSDeviceTemplate,target64,arm64,aarch64))
$(eval $(call iOSDeviceTemplate,targettv,arm64,aarch64))
$(eval $(call iOSDeviceTemplate,targetwatch,armv7k,armv7k))
@@ -210,21 +182,21 @@ $(eval $(call iOSDeviceTemplate,targetwatch,armv7k,armv7k))
# $(2): arch (i386 or x86_64)
#
# Flags:
-# ios_$(1)_SYSROOT
-# ios_$(1)_AC_VARS
-# ios_$(1)_CFLAGS
-# ios_$(1)_CPPFLAGS
-# ios_$(1)_CXXFLAGS
-# ios_$(1)_LDFLAGS
+# ios-$(1)_SYSROOT
+# ios-$(1)_AC_VARS
+# ios-$(1)_CFLAGS
+# ios-$(1)_CPPFLAGS
+# ios-$(1)_CXXFLAGS
+# ios-$(1)_LDFLAGS
#
# This handles tvos/watchos as well.
#
define iOSSimulatorTemplate
-_ios_$(1)_CC=$$(CCACHE) $$(PLATFORM_BIN)/clang
-_ios_$(1)_CXX=$$(CCACHE) $$(PLATFORM_BIN)/clang++
+_ios-$(1)_CC=$$(CCACHE) $$(PLATFORM_BIN)/clang
+_ios-$(1)_CXX=$$(CCACHE) $$(PLATFORM_BIN)/clang++
-_ios_$(1)_AC_VARS= \
+_ios-$(1)_AC_VARS= \
ac_cv_func_clock_nanosleep=no \
ac_cv_func_fstatat=no \
ac_cv_func_readlinkat=no \
@@ -233,45 +205,35 @@ _ios_$(1)_AC_VARS= \
ac_cv_func_futimens=no \
ac_cv_func_utimensat=no \
mono_cv_uscore=yes \
- $(ios_$(1)_AC_VARS)
+ $(ios-$(1)_AC_VARS)
-_ios_$(1)_CFLAGS= \
- $$(ios_CFLAGS) \
- $$(ios_$(1)_SYSROOT) \
+_ios-$(1)_CFLAGS= \
+ $$(ios-$(1)_SYSROOT) \
-arch $(2) \
-Wl,-application_extension \
- $$(ios_$(1)_CFLAGS)
+ $$(ios-$(1)_CFLAGS)
-_ios_$(1)_CPPFLAGS= \
+_ios-$(1)_CPPFLAGS= \
$$(ios_CPPFLAGS) \
- $$(ios_$(1)_SYSROOT) \
+ $$(ios-$(1)_SYSROOT) \
-arch $(2) \
-Wl,-application_extension \
- $$(ios_$(1)_CPPFLAGS)
+ $$(ios-$(1)_CPPFLAGS)
-_ios_$(1)_CXXFLAGS= \
- $$(ios_CXXFLAGS) \
- $$(ios_$(1)_SYSROOT) \
+_ios-$(1)_CXXFLAGS= \
+ $$(ios-$(1)_SYSROOT) \
-arch $(2) \
-Wl,-application_extension\
- $$(ios_$(1)_CXXFLAGS)
+ $$(ios-$(1)_CXXFLAGS)
-_ios_$(1)_LDFLAGS= \
+_ios-$(1)_LDFLAGS= \
$$(ios_LDFLAGS) \
- $$(ios_$(1)_LDFLAGS)
-
-_ios_$(1)_CONFIGURE_ENVIRONMENT = \
- CC="$$(_ios_$(1)_CC)" \
- CXX="$$(_ios_$(1)_CXX)" \
- CFLAGS="$$(_ios_$(1)_CFLAGS)" \
- CPPFLAGS="$$(_ios_$(1)_CPPFLAGS)" \
- CXXFLAGS="$$(_ios_$(1)_CXXFLAGS)" \
- LDFLAGS="$$(_ios_$(1)_LDFLAGS)"
+ $$(ios-$(1)_LDFLAGS)
-_ios_$(1)_CONFIGURE_FLAGS= \
+_ios-$(1)_CONFIGURE_FLAGS= \
--host=$(2)-apple-darwin10 \
- --cache-file=$$(TOP)/sdks/builds/ios-$(1).config.cache \
- --prefix=$$(TOP)/sdks/out/ios-$(1) \
+ --cache-file=$$(TOP)/sdks/builds/ios-$(1)-$$(CONFIGURATION).config.cache \
+ --prefix=$$(TOP)/sdks/out/ios-$(1)-$$(CONFIGURATION) \
--disable-boehm \
--disable-btls \
--disable-executables \
@@ -283,28 +245,14 @@ _ios_$(1)_CONFIGURE_FLAGS= \
--enable-minimal=com,remoting,shared_perfcounters \
--with-tls=pthread \
--without-ikvm-native \
- $$(ios_$(1)_CONFIGURE_FLAGS)
+ $$(ios-$(1)_CONFIGURE_FLAGS)
-# _ios_$(1)_CONFIGURE_FLAGS += --enable-extension-module=xamarin
+# _ios-$(1)_CONFIGURE_FLAGS += --enable-extension-module=xamarin
.stamp-ios-$(1)-toolchain:
touch $$@
-.stamp-ios-$(1)-configure: $$(TOP)/configure
- mkdir -p $$(TOP)/sdks/builds/ios-$(1)
- cd $$(TOP)/sdks/builds/ios-$(1) && PATH="$$(PLATFORM_BIN):$$$$PATH" $$(TOP)/configure $$(_ios_$(1)_AC_VARS) $$(_ios_$(1)_CONFIGURE_ENVIRONMENT) $$(_ios_$(1)_CONFIGURE_FLAGS)
- touch $$@
-
-.PHONY: package-ios-$(1)
-package-ios-$(1):
- $(MAKE) -C $$(TOP)/sdks/builds/ios-$(1)/mono install
- $(MAKE) -C $$(TOP)/sdks/builds/ios-$(1)/support install
-
-.PHONY: clean-ios-$(1)
-clean-ios-$(1):
- rm -rf .stamp-ios-$(1)-toolchain .stamp-ios-$(1)-configure $$(TOP)/sdks/builds/ios-$(1) $$(TOP)/sdks/builds/ios-$(1).config.cache $$(TOP)/sdks/out/ios-$(1)
-
-TARGETS += ios-$(1)
+$$(eval $$(call RuntimeTemplate,ios-$(1)))
endef
@@ -312,19 +260,19 @@ ios_sim_sysroot = -isysroot $(XCODE_DIR)/Platforms/iPhoneSimulator.platform/Deve
tvos_sim_sysroot = -isysroot $(XCODE_DIR)/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator$(TVOS_VERSION).sdk -mtvos-simulator-version-min=$(TVOS_VERSION_MIN)
watchos_sim_sysroot = -isysroot $(XCODE_DIR)/Platforms/WatchSimulator.platform/Developer/SDKs/WatchSimulator$(WATCH_VERSION).sdk -mwatchos-simulator-version-min=$(WATCHOS_VERSION_MIN)
-ios_sim32_SYSROOT = $(ios_sim_sysroot)
-ios_sim64_SYSROOT = $(ios_sim_sysroot)
-ios_simtv_SYSROOT = $(tvos_sim_sysroot)
-ios_simwatch_SYSROOT = $(watchos_sim_sysroot)
+ios-sim32_SYSROOT = $(ios_sim_sysroot)
+ios-sim64_SYSROOT = $(ios_sim_sysroot)
+ios-simtv_SYSROOT = $(tvos_sim_sysroot)
+ios-simwatch_SYSROOT = $(watchos_sim_sysroot)
-ios_simwatch_CONFIGURE_FLAGS = --with-cooperative-gc=yes
+ios-simwatch_CONFIGURE_FLAGS = --with-cooperative-gc=yes
-ios_sim32_CPPFLAGS = -DHOST_IOS
-ios_sim64_CPPFLAGS = -DHOST_IOS
-ios_simtv_CPPFLAGS = -DHOST_APPLETVOS -DTARGET_APPLETVOS
-ios_simwatch_CPPFLAGS = -DHOST_IOS -DHOST_WATCHOS
+ios-sim32_CPPFLAGS = -DHOST_IOS
+ios-sim64_CPPFLAGS = -DHOST_IOS
+ios-simtv_CPPFLAGS = -DHOST_APPLETVOS -DTARGET_APPLETVOS
+ios-simwatch_CPPFLAGS = -DHOST_IOS -DHOST_WATCHOS
-ios_simtv_AC_VARS = \
+ios-simtv_AC_VARS = \
ac_cv_func_pthread_kill=no \
ac_cv_func_kill=no \
ac_cv_func_sigaction=no \
@@ -333,7 +281,7 @@ ios_simtv_AC_VARS = \
ac_cv_func_execve=no \
ac_cv_func_execvp=no \
ac_cv_func_signal=no
-ios_simwatch_AC_VARS = \
+ios-simwatch_AC_VARS = \
ac_cv_func_system=no \
ac_cv_func_pthread_kill=no \
ac_cv_func_kill=no \
@@ -349,9 +297,6 @@ $(eval $(call iOSSimulatorTemplate,sim64,x86_64))
$(eval $(call iOSSimulatorTemplate,simtv,x86_64))
$(eval $(call iOSSimulatorTemplate,simwatch,i386))
-$(TOP)/tools/offsets-tool/MonoAotOffsetsDumper.exe: $(wildcard $(TOP)/tools/offsets-tool/*.cs)
- $(MAKE) -C $(dir $@) MonoAotOffsetsDumper.exe
-
LLVM_REV=3b82b3c9041eb997f627f881a67d20be37264e9c
# Download a prebuilt llvm
@@ -373,44 +318,42 @@ clean-ios-llvm:
# $(5): offsets tool --abi argument
#
# Flags:
-# ios_$(1)_AC_VARS
-# ios_$(1)_CFLAGS
-# ios_$(1)_CXXFLAGS
-# ios_$(1)_LDFLAGS
-# ios_$(1)_CONFIGURE_FLAGS
+# ios-$(1)_AC_VARS
+# ios-$(1)_CFLAGS
+# ios-$(1)_CXXFLAGS
+# ios-$(1)_LDFLAGS
+# ios-$(1)_CONFIGURE_FLAGS
define iOSCrossTemplate
-_ios_$(1)_OFFSET_TOOL_ABI=$(5)
+_ios-$(1)_OFFSET_TOOL_ABI=$(5)
-_ios_$(1)_CC=$$(CCACHE) $$(PLATFORM_BIN)/clang
-_ios_$(1)_CXX=$$(CCACHE) $$(PLATFORM_BIN)/clang++
+_ios-$(1)_CC=$$(CCACHE) $$(PLATFORM_BIN)/clang
+_ios-$(1)_CXX=$$(CCACHE) $$(PLATFORM_BIN)/clang++
-_ios_$(1)_AC_VARS= \
- $$(ios_$(1)_AC_VARS)
+_ios-$(1)_AC_VARS= \
+ $$(ios-$(1)_AC_VARS)
-_ios_$(1)_CFLAGS= \
- $$(ios_CFLAGS) \
+_ios-$(1)_CFLAGS= \
-isysroot $$(XCODE_DIR)/Platforms/MacOSX.platform/Developer/SDKs/MacOSX$$(MACOS_VERSION).sdk -mmacosx-version-min=$$(MACOS_VERSION_MIN) \
-Qunused-arguments \
- $$(ios_$(1)_CFLAGS)
+ $$(ios-$(1)_CFLAGS)
-_ios_$(1)_CXXFLAGS= \
- $$(ios_CXXFLAGS) \
+_ios-$(1)_CXXFLAGS= \
-isysroot $$(XCODE_DIR)/Platforms/MacOSX.platform/Developer/SDKs/MacOSX$$(MACOS_VERSION).sdk -mmacosx-version-min=$$(MACOS_VERSION_MIN) \
-Qunused-arguments \
-stdlib=libc++ \
- $$(ios_$(1)_CXXFLAGS)
+ $$(ios-$(1)_CXXFLAGS)
-_ios_$(1)_LDFLAGS= \
+_ios-$(1)_LDFLAGS= \
$$(ios_LDFLAGS) \
-stdlib=libc++ \
- $$(ios_$(1)_LDFLAGS)
+ $$(ios-$(1)_LDFLAGS)
-_ios_$(1)_CONFIGURE_FLAGS= \
- $$(ios_$(1)_CONFIGURE_FLAGS) \
+_ios-$(1)_CONFIGURE_FLAGS= \
+ $$(ios-$(1)_CONFIGURE_FLAGS) \
--target=$(4) \
- --cache-file=$$(TOP)/sdks/builds/ios-$(1).config.cache \
- --prefix=$$(TOP)/sdks/out/ios-$(1) \
+ --cache-file=$$(TOP)/sdks/builds/ios-$(1)-$$(CONFIGURATION).config.cache \
+ --prefix=$$(TOP)/sdks/out/ios-$(1)-$$(CONFIGURATION) \
--disable-boehm \
--disable-btls \
--disable-iconv \
@@ -423,45 +366,25 @@ _ios_$(1)_CONFIGURE_FLAGS= \
--with-cross-offsets=$(4).h \
--with-llvm=$$(TOP)/sdks/out/ios-$(3)
-_ios_$(1)_CONFIGURE_ENVIRONMENT= \
- CC="$$(_ios_$(1)_CC)" \
- CXX="$$(_ios_$(1)_CXX)" \
- CFLAGS="$$(_ios_$(1)_CFLAGS)" \
- CXXFLAGS="$$(_ios_$(1)_CXXFLAGS)" \
- LDFLAGS="$$(_ios_$(1)_LDFLAGS)"
-
.stamp-ios-$(1)-toolchain:
touch $$@
-.stamp-ios-$(1)-configure: $$(TOP)/configure | build-ios-llvm
- mkdir -p $$(TOP)/sdks/builds/ios-$(1)
- cd $$(TOP)/sdks/builds/ios-$(1) && PATH="$$(PLATFORM_BIN):$$$$PATH" $$(TOP)/configure $$(_ios_$(1)_AC_VARS) $$(_ios_$(1)_CONFIGURE_ENVIRONMENT) $$(_ios_$(1)_CONFIGURE_FLAGS)
- touch $$@
+.stamp-ios-$(1)-configure-$$(CONFIGURATION): | build-ios-llvm
-$$(TOP)/sdks/builds/ios-$(1)/$(4).h: .stamp-ios-$(1)-configure $$(TOP)/tools/offsets-tool/MonoAotOffsetsDumper.exe
- cd $$(TOP)/sdks/builds/ios-$(1) && \
+$$(TOP)/sdks/builds/ios-$(1)-$$(CONFIGURATION)/$(4).h: .stamp-ios-$(1)-configure-$$(CONFIGURATION) $$(TOP)/tools/offsets-tool/MonoAotOffsetsDumper.exe
+ cd $$(TOP)/sdks/builds/ios-$(1)-$$(CONFIGURATION) && \
MONO_PATH=$(TOP)/tools/offsets-tool/CppSharp/osx_32 \
mono --arch=32 --debug $$(TOP)/tools/offsets-tool/MonoAotOffsetsDumper.exe \
- --gen-ios --abi $$(_ios_$(1)_OFFSET_TOOL_ABI) --outfile $$@ --mono $$(TOP) --targetdir $$(TOP)/sdks/builds/ios-$(1)
-
-build-ios-$(1): $$(TOP)/sdks/builds/ios-$(1)/$(4).h
+ --gen-ios --abi $$(_ios_$(1)_OFFSET_TOOL_ABI) --outfile $$@ --mono $$(TOP) --targetdir $$(TOP)/sdks/builds/ios-$(1)-$$(CONFIGURATION)
-.PHONY: package-ios-$(1)
-package-ios-$(1):
- $$(MAKE) -C $$(TOP)/sdks/builds/ios-$(1)/mono install
+build-ios-$(1)-$$(CONFIGURATION): $$(TOP)/sdks/builds/ios-$(1)-$$(CONFIGURATION)/$(4).h
-.PHONY: clean-ios-$(1)
-clean-ios-$(1):
- rm -rf .stamp-ios-$(1)-toolchain .stamp-ios-$(1)-configure $$(TOP)/sdks/builds/ios-$(1) $$(TOP)/sdks/builds/ios-$(1).config.cache $$(TOP)/sdks/out/ios-$(1)
-
-TARGETS += ios-$(1)
+$$(eval $$(call RuntimeTemplate,ios-$(1)))
endef
-ios_cross32_CONFIGURE_FLAGS=--build=i386-apple-darwin10
-ios_crosswatch_CONFIGURE_FLAGS=--build=i386-apple-darwin10 --with-cooperative-gc=yes
+ios-cross32_CONFIGURE_FLAGS=--build=i386-apple-darwin10
+ios-crosswatch_CONFIGURE_FLAGS=--build=i386-apple-darwin10 --with-cooperative-gc=yes
$(eval $(call iOSCrossTemplate,cross32,arm,llvm32,arm-darwin,arm-apple-darwin10))
$(eval $(call iOSCrossTemplate,cross64,aarch64,llvm64,aarch64-darwin,aarch64-apple-darwin10))
$(eval $(call iOSCrossTemplate,crosswatch,armv7k,llvm32,armv7k-unknown-darwin,armv7k-apple-darwin))
-
-configure-mono: $(TOP)/configure
diff --git a/sdks/builds/runtime.mk b/sdks/builds/runtime.mk
new file mode 100644
index 00000000000..1a3b912e048
--- /dev/null
+++ b/sdks/builds/runtime.mk
@@ -0,0 +1,83 @@
+
+##
+# Parameters:
+# $(1): target
+#
+# Flags:
+# _$(1)_AR
+# _$(1)_AS
+# _$(1)_CC
+# _$(1)_CPP
+# _$(1)_CXX
+# _$(1)_CXXCPP
+# _$(1)_DLLTOOL
+# _$(1)_LD
+# _$(1)_OBJDUMP
+# _$(1)_RANLIB
+# _$(1)_STRIP
+# _$(1)_CFLAGS
+# _$(1)_CXXFLAGS
+# _$(1)_CPPFLAGS
+# _$(1)_LDFLAGS
+# _$(1)_AC_VARS
+# _$(1)_CONFIGURE_FLAGS
+# _$(1)_PATH
+define RuntimeTemplate
+
+__$(1)_CFLAGS=$(if $(RELEASE),-O2 -g,-O0 -ggdb3 -fno-omit-frame-pointer) $$(_$(1)_CFLAGS)
+__$(1)_CXXFLAGS=$(if $(RELEASE),-O2 -g,-O0 -ggdb3 -fno-omit-frame-pointer) $$(_$(1)_CXXFLAGS)
+__$(1)_CPPFLAGS=$(if $(RELEASE),-O2 -g,-O0 -ggdb3 -fno-omit-frame-pointer) $$(_$(1)_CPPFLAGS)
+
+__$(1)_CONFIGURE_ENVIRONMENT = \
+ $(if $$(_$(1)_AR),AR="$$(_$(1)_AR)") \
+ $(if $$(_$(1)_AS),AS="$$(_$(1)_AS)") \
+ $(if $$(_$(1)_CC),CC="$$(_$(1)_CC)") \
+ $(if $$(_$(1)_CPP),CPP="$$(_$(1)_CPP)") \
+ $(if $$(_$(1)_CXX),CXX="$$(_$(1)_CXX)") \
+ $(if $$(_$(1)_CXXCPP),CXXCPP="$$(_$(1)_CXXCPP)") \
+ $(if $$(_$(1)_DLLTOOL),DLLTOOL="$$(_$(1)_DLLTOOL)") \
+ $(if $$(_$(1)_LD),LD="$$(_$(1)_LD)") \
+ $(if $$(_$(1)_OBJDUMP),OBJDUMP="$$(_$(1)_OBJDUMP)") \
+ $(if $$(_$(1)_RANLIB),RANLIB="$$(_$(1)_RANLIB)") \
+ $(if $$(_$(1)_STRIP),STRIP="$$(_$(1)_STRIP)") \
+ CFLAGS="$$(__$(1)_CFLAGS)" \
+ CXXFLAGS="$$(__$(1)_CXXFLAGS)" \
+ CPPFLAGS="$$(__$(1)_CPPFLAGS)" \
+ $(if $$(_$(1)_LDFLAGS),LDFLAGS="$$(_$(1)_LDFLAGS)") \
+ $$(_$(1)_CONFIGURE_ENVIRONMENT)
+
+.stamp-$(1)-$$(CONFIGURATION)-configure: $$(TOP)/configure .stamp-$(1)-toolchain
+ mkdir -p $$(TOP)/sdks/builds/$(1)-$$(CONFIGURATION)
+ cd $$(TOP)/sdks/builds/$(1)-$$(CONFIGURATION) && $(if $$(_$(1)_PATH),PATH="$$$$PATH:$$(_$(1)_PATH)") $$(TOP)/configure $$(_$(1)_AC_VARS) $$(__$(1)_CONFIGURE_ENVIRONMENT) $$(_$(1)_CONFIGURE_FLAGS)
+ touch $$@
+
+.PHONY: .stamp-$(1)-configure
+.stamp-$(1)-configure: .stamp-$(1)-$$(CONFIGURATION)-configure
+
+.PHONY: build-custom-$(1)
+build-custom-$(1):
+ $$(MAKE) -C $(1)-$$(CONFIGURATION)
+
+.PHONY: setup-custom-$(1)
+setup-custom-$(1):
+ mkdir -p $$(TOP)/sdks/out/$(1)-$$(CONFIGURATION)
+
+.PHONY: package-android-$(1)-$$(CONFIGURATION)
+package-android-$(1)-$$(CONFIGURATION)::
+ $$(MAKE) -C $$(TOP)/sdks/builds/android-$(1)-$$(CONFIGURATION)/mono install
+
+.PHONY: package-$(1)
+package-$(1):
+ $$(MAKE) package-$(1)-$$(CONFIGURATION)
+
+.PHONY: clean-$(1)-$$(CONFIGURATION)
+clean-$(1)-$$(CONFIGURATION)::
+ rm -rf .stamp-$(1)-toolchain .stamp-$(1)-$$(CONFIGURATION)-configure $$(TOP)/sdks/builds/toolchains/$(1) $$(TOP)/sdks/builds/$(1)-$$(CONFIGURATION) $$(TOP)/sdks/builds/$(1)-$$(CONFIGURATION).config.cache $$(TOP)/sdks/out/$(1)-$$(CONFIGURATION)
+
+.PHONY: clean-$(1)
+clean-$(1):
+ $$(MAKE) clean-$(1)-$$(CONFIGURATION)
+
+TARGETS += $(1)
+
+endef