2016-04-21 11:59:27 +03:00
include $(TOP)/mk/subdirs.mk
# calculate commit distance and store it in a file so that we don't have to re-calculate it every time make is executed.
-include $(TOP)/Make.config.inc
$(TOP)/Make.config.inc: $(TOP)/Make.config
@rm -f $@
2018-10-04 20:49:26 +03:00
@printf "IOS_COMMIT_DISTANCE:=$(shell LANG=C; export LANG && git --git-dir $(TOP)/.git log `git --git-dir $(TOP)/.git blame -- ./Make.versions HEAD | grep IOS_PACKAGE_VERSION= | sed 's/ .*//' `..HEAD --oneline | wc -l | sed 's/ //g')\n" >> $@
@printf "MAC_COMMIT_DISTANCE:=$(shell LANG=C; export LANG && git --git-dir $(TOP)/.git log `git --git-dir $(TOP)/.git blame -- ./Make.versions HEAD | grep MAC_PACKAGE_VERSION= | sed 's/ .*//' `..HEAD --oneline | wc -l | sed 's/ //g')\n" >> $@
2016-04-21 11:59:27 +03:00
@if which ccache > /dev/null 2>&1; then printf "ENABLE_CCACHE=1\nexport CCACHE_BASEDIR=$(abspath $(TOP)/..)\n" >> $@; echo "Found ccache on the system, enabling it"; fi
2017-08-03 16:21:39 +03:00
@if test -d $(TOP)/../maccore; then printf "ENABLE_XAMARIN=1\n" >> $@; echo "Detected the maccore repository, automatically enabled the Xamarin build"; fi
2016-04-21 11:59:27 +03:00
2018-10-04 20:49:26 +03:00
include $(TOP)/Make.versions
2016-04-21 11:59:27 +03:00
PACKAGE_HEAD_REV=$(shell git rev-parse HEAD)
2017-12-06 17:36:08 +03:00
#
# /!\ README /!\
2016-04-21 11:59:27 +03:00
#
2018-10-04 20:49:26 +03:00
# A release branch requires updating some variables.
# This is done in Make.versions, not here.
2016-04-21 11:59:27 +03:00
#
2018-08-28 18:08:36 +03:00
ifeq ($(BRANCH_NAME),)
# BRANCH_NAME is set in Jenkins, so this is for local builds.
2016-04-21 11:59:27 +03:00
CURRENT_BRANCH:=$(shell git rev-parse --abbrev-ref HEAD)
else
2018-08-28 18:08:36 +03:00
CURRENT_BRANCH:=$(BRANCH_NAME)
2016-04-21 11:59:27 +03:00
endif
2017-09-11 15:10:13 +03:00
2016-04-21 11:59:27 +03:00
IOS_PRODUCT=Xamarin.iOS
IOS_PACKAGE_NAME=Xamarin.iOS
IOS_PACKAGE_NAME_LOWER=$(shell echo $(IOS_PACKAGE_NAME) | tr "[:upper:]" "[:lower:]")
IOS_PACKAGE_VERSION_MAJOR=$(word 1, $(subst ., ,$(IOS_PACKAGE_VERSION)))
IOS_PACKAGE_VERSION_MINOR=$(word 2, $(subst ., ,$(IOS_PACKAGE_VERSION)))
2018-10-04 20:49:26 +03:00
IOS_PACKAGE_VERSION_REV:=$(word 3, $(subst ., ,$(IOS_PACKAGE_VERSION)))
2016-04-21 11:59:27 +03:00
IOS_PACKAGE_VERSION_BUILD=$(IOS_COMMIT_DISTANCE)
IOS_PACKAGE_UPDATE_ID=$(shell printf "2%02d%02d%02d%03d" $(IOS_PACKAGE_VERSION_MAJOR) $(IOS_PACKAGE_VERSION_MINOR) $(IOS_PACKAGE_VERSION_REV) $(IOS_PACKAGE_VERSION_BUILD))
2018-06-09 04:45:24 +03:00
# Xcode version should have both a major and a minor version (even if the minor version is 0)
2018-09-19 15:56:43 +03:00
XCODE_VERSION=10.1
2018-10-31 04:12:54 +03:00
XCODE_URL=http://xamarin-storage/bot-provisioning/xcodes/Xcode_10.1.xip
XCODE_DEVELOPER_ROOT=/Applications/Xcode101.app/Contents/Developer
2016-04-21 11:59:27 +03:00
2018-06-09 04:45:24 +03:00
XCODE94_VERSION=9.4
XCODE94_URL=http://xamarin-storage/bot-provisioning/xcodes/Xcode_9.4.xip
XCODE94_DEVELOPER_ROOT=/Applications/Xcode94.app/Contents/Developer
2016-04-21 11:59:27 +03:00
2018-11-05 16:46:41 +03:00
# Minimum Mono version for building XI/XM
2018-07-30 17:03:35 +03:00
MIN_MONO_VERSION=5.16.0.5
MAX_MONO_VERSION=5.16.99
MIN_MONO_URL=https://xamjenkinsartifact.azureedge.net/build-package-osx-mono/2018-06/7/7627a5f9eeba0fd846731ad0c498556f55be1a34/MonoFramework-MDK-5.16.0.5.macos10.xamarin.universal.pkg
2016-04-21 11:59:27 +03:00
Store the minimum mono version for Xamarin.Mac in one place only (Make.config) and bump it to 5.14. Fixes #4120. (#4695)
* Store the minimum mono version for Xamarin.Mac in one place only (Make.config) and bump it to 5.14. Fixes #4120.
I've verified that we fail at launch of running on 5.12, while 5.14 works fine
(to launch at least), so the minimum system mono version is _at least_ 5.14.
Fixes https://github.com/xamarin/xamarin-macios/issues/4120.
* [mmp] Load mono's version file instead of using pkg-config to get mono's version.
pkg-config will only get three parts of the version, while the version file
has all four parts.
This is important, since we're now verifying the four parts of the version
file, and without loading those four from the system, we'll fail builds like
this:
error MM0001: This version of Xamarin.Mac requires Mono 5.14.0.136 (the current Mono version is 5.14.0).
because the three part version's fourth number is assumed to be 0.
* Only verify mono runtime version when running with system/dynamic mono.
There should be no need to verify the mono runtime version when embedding mono:
* If it's a mono we're shipping, something very bad happened in our
build/package for it to be an invalid mono.
* If it's a system mono that's being embedded, then we verify in mmp at build
time.
In the first scenario (a mono we're shipping), the problem is that the mono
we've built does not report back the full version number (with four parts) [1],
which means we'll fail any check whose requirements are identical for the
first three parts, and non-zero for the last.
[1] The fourth part of the version number is created/calculated when packaging
mono, and we're not packaging it.
2018-08-29 15:28:56 +03:00
# Minimum Mono version for Xamarin.Mac apps using the system mono
MIN_XM_MONO_VERSION=5.14.0.136
MIN_XM_MONO_URL=https://xamjenkinsartifact.azureedge.net/build-package-osx-mono/2018-04/111/07c8f25fe536dbb7e244f965aa3f9a871f41e953/MonoFramework-MDK-5.14.0.136.macos10.xamarin.universal.pkg
2016-04-21 11:59:27 +03:00
2017-04-06 18:12:32 +03:00
# Minimum Visual Studio version
2018-10-10 18:02:28 +03:00
MIN_VISUAL_STUDIO_URL=https://bosstoragemirror.azureedge.net/vsmac/7a/7aff2dc1f28d711d11d63d79b2a4c49cda217189/VisualStudioForMac-Preview-7.7.0.1470.dmg
MIN_VISUAL_STUDIO_VERSION=7.7.0.1470
MAX_VISUAL_STUDIO_VERSION=7.8.99
2016-04-21 11:59:27 +03:00
2016-09-30 22:46:40 +03:00
# Minimum CMake version
MIN_CMAKE_URL=https://cmake.org/files/v3.6/cmake-3.6.2-Darwin-x86_64.dmg
MIN_CMAKE_VERSION=2.8.8
2017-10-17 13:03:50 +03:00
# ObjectiveSharpie min/max versions
2018-02-07 21:21:49 +03:00
MIN_SHARPIE_VERSION=3.4.23
2017-10-17 13:03:50 +03:00
MAX_SHARPIE_VERSION=3.4.99
2018-02-07 21:21:49 +03:00
MIN_SHARPIE_URL=https://bosstoragemirror.blob.core.windows.net/objective-sharpie/builds/4cde014216e8887375f9793d3a2607529833443b/440/76194/ObjectiveSharpie-3.4.23.pkg
2017-10-17 13:03:50 +03:00
2018-11-05 16:46:41 +03:00
# Minimum OSX versions for building XI/XM
2018-04-24 21:47:15 +03:00
MIN_OSX_BUILD_VERSION=10.13
2018-11-05 16:46:41 +03:00
# Minimum OSX version for executing XI/XM tooling.
2016-09-13 00:43:43 +03:00
MIN_OSX_VERSION_FOR_IOS=10.11
MIN_OSX_VERSION_FOR_MAC=10.11
2016-04-21 11:59:27 +03:00
2018-09-19 15:56:43 +03:00
IOS_SDK_VERSION=12.1
Add support for building on Jenkins. (#4159)
Add support for building on internal Jenkins.
Jenkins has been configured to build every branch on xamarin/xamarin-macios that contains a `jenkins/Jenkinsfile`, which means it will start working as soon as this PR is merged.
Results will be posted as statuses on each commit, which can be viewed using the url `https://github.com/xamarin/xamarin-macios/commits/<branch>`:
![screenshot 2018-06-01 11 12 57](https://user-images.githubusercontent.com/249268/40832932-c3b05eb0-658c-11e8-9670-8de5fcc23407.png)
* The `continuous-integration/jenkins/branch` status links to the jenkins job.
* The other two are XI and XM packages (the `Jenkins-` prefix will be removed once we officially switch from Wrench to Jenkins).
More detailed information will be added as a comment to each commit, which can be seen by clicking on the commit and scrolling to the bottom (url of the format `https://github.com/xamarin/xamarin-macios/commit/<sha1>`)
![screenshot 2018-06-01 11 14 33](https://user-images.githubusercontent.com/249268/40833014-fd8772f4-658c-11e8-8a35-5df46bfb16c7.png)
Unfortunately GitHub does not display the commit statuses when viewing a single commit, so to view those statuses you'll have to view the list of commits (the `/commits/` url). Tip: it's possible to use `<sha1>` instead of `<branch>` (and vice versa for that matter) if you're interested in the statuses of a particular commit.
Pull requests will also be built (only from contributors with write access), but by default nothing will be done (the job will exit immediately, although a green check mark will still show up). Jenkins will **not** add a comment in the pull request in this case.
However, if the label `build-package` [1] is set for a pull request, the internal jenkins job will run (it will do everything except the local xharness test run: this includes creating and publishing packages, creating various diffs, run tests on older macOS versions, test docs, etc). A detailed comment will also be added to the pull request (see below for multiple examples), which means that there will be two Jenkins comments: one for the public Jenkins which builds every PR, and one for the internal Jenkins [2].
[1] I don't quite like the name of the label, because it doesn't get even close to explain all that will actually happen, but `run-on-internal-jenkins-and-create-package` is a bit too long IMHO... Also it's non-obvious that this is the label to apply if the reason for executing on the internal jenkins is some other reason (for instance to test a maccore bump). Other ideas:
* `run-internal-jenkins`: doesn't make it obvious that a package will be created (which is probably the most common reason to want to run on internal jenkins)
* We could have multiple labels that mean the same thing: `build-package`, `internal-build`, `run-internal-jenkins`, etc, but it's redundant and I don't quite like it either.
* Any other ideas?
[2] I'm noticing now that these two look quite similar and this might end up confusing (the main difference is that the comment from the public jenkins will say **Build success/failure** and **Build comment file:** at the top. If something goes wrong the failure will also show up differently). Should this be made clearer?
2018-06-05 02:40:16 +03:00
# When bumping OSX_SDK_VERSION also update the macOS version where we execute on bots in jenkins/Jenkinsfile (in the 'node' element)
2018-06-09 04:45:24 +03:00
OSX_SDK_VERSION=10.14
2018-09-19 15:56:43 +03:00
WATCH_SDK_VERSION=5.1
TVOS_SDK_VERSION=12.1
2016-04-21 11:59:27 +03:00
2018-11-05 16:46:41 +03:00
# Minimum OS versions for running XI/XM apps.
2016-06-14 23:43:51 +03:00
MIN_IOS_SDK_VERSION=6.0
2016-04-21 11:59:27 +03:00
MIN_OSX_SDK_VERSION=10.7
MIN_WATCHOS_SDK_VERSION=2.0
2016-12-13 12:52:58 +03:00
MIN_WATCH_OS_VERSION=1.0
2016-04-21 11:59:27 +03:00
MIN_TVOS_SDK_VERSION=9.0
INCLUDE_IOS=1
INCLUDE_MAC=1
INCLUDE_WATCH=1
INCLUDE_TVOS=1
2016-05-19 15:33:35 +03:00
INCLUDE_DEVICE=1
2016-04-21 11:59:27 +03:00
-include $(TOP)/Make.config.local
2016-04-26 19:38:15 +03:00
-include $(TOP)/configure.inc
2016-04-21 11:59:27 +03:00
ifdef ENABLE_CCACHE
# Note the space at the end the line
CCACHE=ccache
endif
2016-09-13 00:43:43 +03:00
#DISABLE_APPLETLS=1
2016-04-21 11:59:27 +03:00
ifdef DISABLE_APPLETLS
APPLETLS_DEFINES = -d:XAMARIN_NO_TLS
else
APPLETLS_DEFINES = -d:XAMARIN_APPLETLS
endif
2018-06-09 04:45:24 +03:00
XCODE_MAC_SDKROOT=$(XCODE_DEVELOPER_ROOT)/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
XCODE94_MAC_SDKROOT=$(XCODE94_DEVELOPER_ROOT)/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
2016-04-21 11:59:27 +03:00
2018-11-05 16:46:41 +03:00
# The MAC_* variables do not contain the -mmacosx-version-min flag on purpose: each usage must specify it separately.
MAC_CC=$(CCACHE)$(XCODE_DEVELOPER_ROOT)/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -isysroot $(XCODE_MAC_SDKROOT) -stdlib=libc++
MAC_CXX=$(CCACHE)$(XCODE_DEVELOPER_ROOT)/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -isysroot $(XCODE_MAC_SDKROOT) -stdlib=libc++
2016-04-21 11:59:27 +03:00
2018-11-05 16:46:41 +03:00
MAC32_CC=$(CCACHE)$(XCODE94_DEVELOPER_ROOT)/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -isysroot $(XCODE94_MAC_SDKROOT) -stdlib=libc++
MAC32_CXX=$(CCACHE)$(XCODE94_DEVELOPER_ROOT)/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -isysroot $(XCODE94_MAC_SDKROOT) -stdlib=libc++
2016-04-21 11:59:27 +03:00
# This is the temporary directory where the various builds are installed
BUILD_DESTDIR=$(abspath $(TOP)/builds/install)
MAC_INSTALL_VERSION ?= git
IOS_INSTALL_VERSION ?= git
IOS_DESTDIR ?= $(TOP)/_ios-build
IOS_TARGETDIR ?= $(IOS_DESTDIR)
USE_SOURCE_LINKS ?= 1
IOS_FRAMEWORK_DIR=/Library/Frameworks/Xamarin.iOS.framework
# Prefix used to install monotouch
ifndef MONOTOUCH_PREFIX
MONOTOUCH_PREFIX=$(IOS_FRAMEWORK_DIR)/Versions/$(IOS_INSTALL_VERSION)
endif
XCODE_CC=$(CCACHE)$(XCODE_DEVELOPER_ROOT)/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
XCODE_CXX=$(CCACHE)$(XCODE_DEVELOPER_ROOT)/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++
# make sure we have full paths. The patsubst function is to remove any trailing slash (this may leave the variable empty)
override IOS_DESTDIR := $(patsubst %/,%,$(abspath $(IOS_DESTDIR)))
override IOS_TARGETDIR := $(patsubst %/,%,$(abspath $(IOS_TARGETDIR)))
MONOTOUCH_PREFIX := $(abspath $(MONOTOUCH_PREFIX))
MONOTOUCH_MONO_PATH?=$(abspath $(MONO_PATH)/mcs/class/lib/monotouch/)
2017-04-18 18:13:40 +03:00
MONOTOUCH_TV_MONO_PATH?=$(abspath $(MONO_PATH)/mcs/class/lib/monotouch_tv/)
MONOTOUCH_WATCH_MONO_PATH?=$(abspath $(MONO_PATH)/mcs/class/lib/monotouch_watch/)
2016-04-21 11:59:27 +03:00
IOS_PACKAGE_FILENAME=$(IOS_PACKAGE_NAME_LOWER)-$(IOS_PACKAGE_VERSION).pkg
IOS_PACKAGE_UTI=com.xamarin.$(IOS_PACKAGE_NAME_LOWER).pkg
IOS_COMMON_DEFINES=-DMONOTOUCH
IOS_CC=$(XCODE_CC)
IOS_CXX=$(XCODE_CXX)
SIMULATOR_BIN_PATH=$(XCODE_DEVELOPER_ROOT)/Platforms/iPhoneSimulator.platform/Developer/usr/bin
SIMULATOR_CC=$(IOS_CC)
CFLAGS= -Wall -fms-extensions -Wno-format-security
ifdef ENABLE_BITCODE_ON_IOS
BITCODE_CFLAGS=-fembed-bitcode-marker
# Overwrite the default
MIN_IOS_SDK_VERSION=9.0
endif
SIMULATOR_SDK=$(XCODE_DEVELOPER_ROOT)/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator$(IOS_SDK_VERSION).sdk
2018-06-28 15:49:22 +03:00
OBJC_CFLAGS=-ObjC++ -std=c++0x -fno-exceptions -stdlib=libc++
2016-04-21 11:59:27 +03:00
COMMON_SIMULATOR_CFLAGS=-mios-simulator-version-min=$(MIN_IOS_SDK_VERSION) -isysroot $(SIMULATOR_SDK) $(CFLAGS) -g $(IOS_COMMON_DEFINES)
SIMULATOR86_CFLAGS=$(COMMON_SIMULATOR_CFLAGS) -arch i386
SIMULATOR64_CFLAGS=$(COMMON_SIMULATOR_CFLAGS) -arch x86_64
COMMON_SIMULATOR_OBJC_CFLAGS=-fobjc-abi-version=2 -fobjc-legacy-dispatch $(CFLAGS) $(OBJC_CFLAGS)
SIMULATOR86_OBJC_CFLAGS=$(COMMON_SIMULATOR_OBJC_CFLAGS) $(SIMULATOR86_CFLAGS)
SIMULATOR64_OBJC_CFLAGS=$(COMMON_SIMULATOR_OBJC_CFLAGS) $(SIMULATOR64_CFLAGS)
MONOTOUCH_SIMULATOR_SDK=$(MONOTOUCH_PREFIX)/SDKs/MonoTouch.iphonesimulator.sdk
DEVICE_BIN_PATH=$(XCODE_DEVELOPER_ROOT)/Toolchains/XcodeDefault.xctoolchain/usr/bin
DEVICE_CC=$(IOS_CC)
DEVICE_CXX=$(IOS_CXX)
2018-04-27 08:44:34 +03:00
IOS_CSC=$(SYSTEM_CSC) -nostdlib -noconfig -r:$(MONOTOUCH_MONO_PATH)/System.dll -r:$(MONOTOUCH_MONO_PATH)/System.Core.dll -r:$(MONOTOUCH_MONO_PATH)/System.Xml.dll -r:$(MONOTOUCH_MONO_PATH)/mscorlib.dll -r:$(MONOTOUCH_MONO_PATH)/System.Net.Http.dll -deterministic
2017-04-18 18:13:40 +03:00
IOS_MCS=$(SYSTEM_MCS) -nostdlib -r:mscorlib.dll -lib:$(MONOTOUCH_MONO_PATH)
2016-04-21 11:59:27 +03:00
2018-04-27 08:44:34 +03:00
TV_CSC=$(SYSTEM_CSC) -nostdlib -noconfig -r:$(MONOTOUCH_TV_MONO_PATH)/System.dll -r:$(MONOTOUCH_TV_MONO_PATH)/System.Core.dll -r:$(MONOTOUCH_TV_MONO_PATH)/System.Xml.dll -r:$(MONOTOUCH_TV_MONO_PATH)/mscorlib.dll -deterministic
WATCH_CSC=$(SYSTEM_CSC) -nostdlib -noconfig -r:$(WATCH_BCL_DIR)/System.dll -r:$(WATCH_BCL_DIR)/System.Core.dll -r:$(WATCH_BCL_DIR)/System.Xml.dll -r:$(WATCH_BCL_DIR)/mscorlib.dll -deterministic
2018-02-22 20:07:33 +03:00
2016-04-21 11:59:27 +03:00
DEVICE_OBJC_CFLAGS=$(OBJC_CFLAGS) $(BITCODE_CFLAGS)
DEVICE_SDK=$(XCODE_DEVELOPER_ROOT)/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS$(IOS_SDK_VERSION).sdk
DEVICE7_CFLAGS= -arch armv7 -mno-thumb -miphoneos-version-min=$(MIN_IOS_SDK_VERSION) -isysroot $(DEVICE_SDK) $(CFLAGS) $(IOS_COMMON_DEFINES)
DEVICE7S_CFLAGS=-arch armv7s -mno-thumb -miphoneos-version-min=$(MIN_IOS_SDK_VERSION) -isysroot $(DEVICE_SDK) $(CFLAGS) $(IOS_COMMON_DEFINES)
DEVICE64_CFLAGS=-arch arm64 -miphoneos-version-min=7.0 -isysroot $(DEVICE_SDK) $(CFLAGS) $(IOS_COMMON_DEFINES)
DEVICE7_OBJC_CFLAGS =$(DEVICE7_CFLAGS) $(DEVICE_OBJC_CFLAGS)
DEVICE7S_OBJC_CFLAGS=$(DEVICE7S_CFLAGS) $(DEVICE_OBJC_CFLAGS)
DEVICE64_OBJC_CFLAGS=$(DEVICE64_CFLAGS) $(DEVICE_OBJC_CFLAGS)
MONOTOUCH_DEVICE_SDK=$(MONOTOUCH_PREFIX)/SDKs/MonoTouch.iphoneos.sdk
# iOS
XAMARIN_IOSSIMULATOR_SDK = $(MONOTOUCH_SIMULATOR_SDK)
XAMARIN_IPHONEOS_SDK = $(MONOTOUCH_DEVICE_SDK)
# WatchOS
XAMARIN_WATCHSIMULATOR_SDK = $(MONOTOUCH_PREFIX)/SDKs/Xamarin.WatchSimulator.sdk
XAMARIN_WATCHOS_SDK = $(MONOTOUCH_PREFIX)/SDKs/Xamarin.WatchOS.sdk
2016-06-21 17:24:16 +03:00
SIMULATORWATCH_SDK = $(XCODE_DEVELOPER_ROOT)/Platforms/WatchSimulator.platform/Developer/SDKs/WatchSimulator$(WATCH_SDK_VERSION).sdk
2016-04-21 11:59:27 +03:00
SIMULATORWATCH_CFLAGS = -arch i386 -mwatchos-simulator-version-min=$(MIN_WATCHOS_SDK_VERSION) -isysroot $(SIMULATORWATCH_SDK) $(CFLAGS) -g $(IOS_COMMON_DEFINES)
SIMULATORWATCH_OBJC_CFLAGS = $(SIMULATORWATCH_CFLAGS) $(COMMON_SIMULATOR_OBJC_CFLAGS)
2016-06-21 17:24:16 +03:00
DEVICEWATCH_SDK = $(XCODE_DEVELOPER_ROOT)/Platforms/WatchOS.platform/Developer/SDKs/WatchOS$(WATCH_SDK_VERSION).sdk
2016-04-21 11:59:27 +03:00
DEVICEWATCH_CFLAGS = -arch armv7k -mwatchos-version-min=$(MIN_WATCHOS_SDK_VERSION) -isysroot $(DEVICEWATCH_SDK) $(CFLAGS) -fembed-bitcode $(IOS_COMMON_DEFINES)
DEVICEWATCH_OBJC_CFLAGS = $(DEVICEWATCH_CFLAGS) $(DEVICE_OBJC_CFLAGS)
# TVOS
XAMARIN_TVSIMULATOR_SDK = $(MONOTOUCH_PREFIX)/SDKs/Xamarin.AppleTVSimulator.sdk
XAMARIN_TVOS_SDK = $(MONOTOUCH_PREFIX)/SDKs/Xamarin.AppleTVOS.sdk
2016-06-21 17:24:16 +03:00
SIMULATORTV_SDK = $(XCODE_DEVELOPER_ROOT)/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator$(TVOS_SDK_VERSION).sdk
2016-04-21 11:59:27 +03:00
SIMULATORTV_CFLAGS = -arch x86_64 -mtvos-simulator-version-min=$(MIN_TVOS_SDK_VERSION) -isysroot $(SIMULATORTV_SDK) $(CFLAGS) -g $(IOS_COMMON_DEFINES)
SIMULATORTV_OBJC_CFLAGS = $(SIMULATORTV_CFLAGS) $(COMMON_SIMULATOR_OBJC_CFLAGS)
2016-06-21 17:24:16 +03:00
DEVICETV_SDK = $(XCODE_DEVELOPER_ROOT)/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS$(TVOS_SDK_VERSION).sdk
2016-04-21 11:59:27 +03:00
DEVICETV_CFLAGS = -arch arm64 -mtvos-version-min=$(MIN_TVOS_SDK_VERSION) -isysroot $(DEVICETV_SDK) $(CFLAGS) -fembed-bitcode $(IOS_COMMON_DEFINES)
DEVICETV_OBJC_CFLAGS = $(DEVICETV_CFLAGS) $(DEVICE_OBJC_CFLAGS)
2016-04-21 14:18:44 +03:00
# paths to the modules we depend on, as variables, so people can put
# things in other places if they absolutely must.
MONO_PATH=$(TOP)/external/mono
2016-04-21 15:30:02 +03:00
TOUCH_UNIT_PATH=$(TOP)/external/Touch.Unit
2016-05-04 16:26:23 +03:00
NUNITLITE_PATH=$(TOP)/external/mono/external/nunit-lite
2016-04-21 15:30:02 +03:00
OPENTK_PATH=$(TOP)/external/opentk
2016-04-21 16:40:25 +03:00
XAMARIN_MACDEV_PATH=$(TOP)/external/Xamarin.MacDev
2016-05-04 22:12:18 +03:00
GUI_UNIT_PATH=$(TOP)/external/guiunit
2016-04-21 19:01:11 +03:00
MACCORE_PATH=$(TOP)/../maccore
2017-09-20 18:07:14 +03:00
LINKER_TOOLS_PATH=$(MONO_PATH)/external/linker
2017-11-22 18:24:39 +03:00
MACIOS_BINARIES_PATH=$(TOP)/external/macios-binaries
2016-04-21 14:18:44 +03:00
2016-04-21 11:59:27 +03:00
MONO_PREFIX ?= /Library/Frameworks/Mono.framework/Versions/Current
SYSTEM_MCS=$(MONO_PREFIX)/bin/mcs
2018-04-18 12:17:00 +03:00
SYSTEM_CSC=$(MONO_PREFIX)/bin/csc
2016-04-21 11:59:27 +03:00
SYSTEM_SN=$(MONO_PREFIX)/bin/sn
SYSTEM_MONO=$(MONO_PREFIX)/bin/mono
2017-04-11 16:01:57 +03:00
SYSTEM_MONO32=$(MONO_PREFIX)/bin/mono32
2018-05-10 00:00:38 +03:00
SYSTEM_XBUILD=$(MONO_PREFIX)/bin/msbuild
2017-10-13 08:48:52 +03:00
SYSTEM_MSBUILD=unset MSBuildExtensionsPath && $(MONO_PREFIX)/bin/msbuild
2016-04-21 11:59:27 +03:00
SYSTEM_RESGEN=$(MONO_PREFIX)/bin/resgen
PKG_CONFIG=$(MONO_PREFIX)/bin/pkg-config
MAC_PRODUCT=Xamarin.Mac
MAC_PACKAGE_NAME=xamarin.mac
MAC_PACKAGE_NAME_LOWER=$(shell echo $(MAC_PACKAGE_NAME) | tr "[:upper:]" "[:lower:]")
MAC_PACKAGE_VERSION_MAJOR=$(word 1, $(subst ., ,$(MAC_PACKAGE_VERSION)))
MAC_PACKAGE_VERSION_MINOR=$(word 2, $(subst ., ,$(MAC_PACKAGE_VERSION)))
2018-10-04 20:49:26 +03:00
MAC_PACKAGE_VERSION_REV=$(word 3, $(subst ., ,$(MAC_PACKAGE_VERSION)))
2016-04-21 11:59:27 +03:00
MAC_PACKAGE_VERSION_BUILD=$(word 4, $(subst ., ,$(MAC_PACKAGE_VERSION)))
MAC_PACKAGE_VERSION_MAJOR_MINOR=$(MAC_PACKAGE_VERSION_MAJOR).$(MAC_PACKAGE_VERSION_MINOR)
MAC_PACKAGE_UPDATE_ID=$(shell echo $(subst ., ,$(MAC_PACKAGE_VERSION).$(MAC_PACKAGE_VERSION_BUILD)) | awk '{printf "2%02d%02d%02d%03d",$$1,$$2,$$3,$$4}')
MAC_PACKAGE_TITLE=Xamarin $(MAC_PACKAGE_NAME) $(MAC_PACKAGE_VERSION)
MAC_DESTDIR ?= $(TOP)/_mac-build
MAC_TARGETDIR ?= $(MAC_DESTDIR)
# make sure we have full paths. The patsubst function is to remove any trailing slash (this may leave the variable empty)
override MAC_DESTDIR := $(patsubst %/,%,$(abspath $(MAC_DESTDIR)))
override MAC_TARGETDIR := $(patsubst %/,%,$(abspath $(MAC_TARGETDIR)))
MAC_FRAMEWORK_DIR = /Library/Frameworks/Xamarin.Mac.framework
MAC_FRAMEWORK_VERSIONED_DIR = $(MAC_FRAMEWORK_DIR)/Versions/$(MAC_PACKAGE_VERSION)
MAC_FRAMEWORK_CURRENT_DIR = $(MAC_FRAMEWORK_DIR)/Versions/$(MAC_INSTALL_VERSION)
2018-02-22 20:07:33 +03:00
MOBILE_BCL_DIR = $(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/lib/mono/Xamarin.Mac
2018-04-27 08:44:34 +03:00
MAC_mobile_CSC = $(SYSTEM_CSC) -nostdlib -noconfig -r:$(MOBILE_BCL_DIR)/System.dll -r:$(MOBILE_BCL_DIR)/System.Core.dll -r:$(MOBILE_BCL_DIR)/System.Xml.dll -r:$(MOBILE_BCL_DIR)/mscorlib.dll -r:$(MOBILE_BCL_DIR)/System.Net.Http.dll -deterministic
2018-02-22 20:07:33 +03:00
FULL_BCL_DIR = $(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/lib/mono/4.5
2018-04-27 08:44:34 +03:00
MAC_full_CSC = $(SYSTEM_CSC) -nostdlib -noconfig -r:$(FULL_BCL_DIR)/System.dll -r:$(FULL_BCL_DIR)/System.Core.dll -r:$(FULL_BCL_DIR)/System.Xml.dll -r:$(FULL_BCL_DIR)/mscorlib.dll -r:$(FULL_BCL_DIR)/System.Net.Http.dll -deterministic
2018-02-22 20:07:33 +03:00
2016-04-21 11:59:27 +03:00
MAC_PACKAGE_FILENAME=$(MAC_PACKAGE_NAME_LOWER)-$(MAC_PACKAGE_VERSION).pkg
MAC_PACKAGE_DMG_FILENAME=$(MAC_PACKAGE_NAME_LOWER)-$(MAC_PACKAGE_VERSION).dmg
MAC_PACKAGE_DMG_DIRNAME="$(MAC_PACKAGE_TITLE)"
MAC_PACKAGE_UTI=com.$(MAC_PACKAGE_NAME_LOWER).pkg
MAC_PACKAGE_INSTALL_LOCATION=$(MAC_FRAMEWORK_VERSIONED_DIR)
2017-04-11 09:13:34 +03:00
TT = $(SYSTEM_MONO) "/Applications/Visual Studio.app/Contents/Resources/lib/monodevelop/AddIns/MonoDevelop.TextTemplating/TextTransform.exe"
2016-04-21 11:59:27 +03:00
PRODUCT_KEY_PATH?=$(TOP)/product.snk
include $(TOP)/mk/quiet.mk
2017-04-11 09:13:34 +03:00
MDTOOL?="/Applications/Visual Studio.app/Contents/MacOS/vstool" $(MDTOOL_VERBOSITY)
2016-06-06 14:01:24 +03:00
2017-12-05 16:13:59 +03:00
IOS_SOURCE=$(TOP)/src
IOS_BUILD_SOURCE=$(IOS_SOURCE)/build/ios/native
IOS_COMMON_BUILD_SOURCE=$(IOS_SOURCE)/build/common
MAC_SOURCE=$(TOP)/src
MAC_FULL_BUILD_SOURCE=$(MAC_SOURCE)/build/mac/full
MAC_MODERN_BUILD_SOURCE=$(MAC_SOURCE)/build/mac/mobile
MAC_COMMON_BUILD_SOURCE=$(MAC_SOURCE)/build/common
2016-11-01 23:05:54 +03:00
ifneq ($(BUILD_REVISION),)
# wrench build only
2018-04-18 12:17:00 +03:00
IOS_CSC_FLAGS=-pathmap:"$(abspath $(MONO_PATH))/=$(IOS_FRAMEWORK_DIR)/Versions/$(IOS_PACKAGE_VERSION)/src/Xamarin.iOS/"
IOS_CSC_FLAGS_XI=-pathmap:"$(abspath $(IOS_COMMON_BUILD_SOURCE))/=$(IOS_FRAMEWORK_DIR)/Versions/$(IOS_PACKAGE_VERSION)/src/Xamarin.iOS/" -pathmap:"$(abspath $(IOS_BUILD_SOURCE))/=$(IOS_FRAMEWORK_DIR)/Versions/$(IOS_PACKAGE_VERSION)/src/Xamarin.iOS/" -pathmap:"$(abspath $(IOS_SOURCE))/=$(IOS_FRAMEWORK_DIR)/Versions/$(IOS_PACKAGE_VERSION)/src/Xamarin.iOS/"
2017-12-05 16:13:59 +03:00
2018-04-18 12:17:00 +03:00
MAC_CSC_FLAGS=-pathmap:"$(abspath $(MONO_PATH))/=$(MAC_FRAMEWORK_DIR)/Versions/$(MAC_PACKAGE_VERSION)/src/Xamarin.Mac/"
MAC_CSC_FLAGS_XM=-pathmap:"$(abspath $(MAC_COMMON_BUILD_SOURCE))/=$(MAC_FRAMEWORK_DIR)/Versions/$(MAC_PACKAGE_VERSION)/src/Xamarin.Mac/" -pathmap:"$(abspath $(MAC_FULL_BUILD_SOURCE))/=$(MAC_FRAMEWORK_DIR)/Versions/$(MAC_PACKAGE_VERSION)/src/Xamarin.Mac/" -pathmap:"$(abspath $(MAC_MODERN_BUILD_SOURCE))/=$(MAC_FRAMEWORK_DIR)/Versions/$(MAC_PACKAGE_VERSION)/src/Xamarin.Mac/" -pathmap:"$(abspath $(MAC_SOURCE))/=$(MAC_FRAMEWORK_DIR)/Versions/$(MAC_PACKAGE_VERSION)/src/Xamarin.Mac/"
2016-11-01 23:05:54 +03:00
endif
2016-04-21 19:01:11 +03:00
ifdef ENABLE_XAMARIN
-include $(MACCORE_PATH)/Make.config
endif
2016-06-02 15:30:17 +03:00
JENKINS_RESULTS_DIRECTORY ?= $(abspath $(TOP)/jenkins-results)
2018-10-29 18:09:30 +03:00
# Clone files instead of copying them on APFS file systems. Much faster.
CP:=$(shell df -t apfs / >/dev/null 2>&1 && echo "cp -c" || echo "cp")
2016-04-21 11:59:27 +03:00
.SUFFIXES:
MAKEFLAGS += --no-builtin-rules