2016-04-21 11:59:27 +03:00
TOP = .
2024-10-10 10:43:15 +03:00
SUBDIRS = builds runtime src msbuild tools
2016-04-21 11:59:27 +03:00
i n c l u d e $( TOP ) / M a k e . c o n f i g
i n c l u d e $( TOP ) / m k / v e r s i o n s . m k
2016-04-21 14:45:14 +03:00
2021-02-11 17:35:04 +03:00
SUBDIRS += dotnet
2016-04-21 14:45:14 +03:00
#
# Common
#
2019-05-12 19:06:06 +03:00
all-local :: check -system
2020-05-14 17:45:23 +03:00
install-local ::
2019-05-12 19:06:06 +03:00
2016-04-21 14:47:16 +03:00
.PHONY : world
world : check -system
@$( MAKE) reset-versions
@$( MAKE) all -j8
@$( MAKE) install -j8
2016-04-21 14:46:12 +03:00
.PHONY : check -system
check-system :
2020-09-16 18:02:44 +03:00
i f d e f I N C L U D E _ M A C
i f d e f I N C L U D E _ I O S
2018-10-04 20:49:26 +03:00
@if [ [ " x $( IOS_COMMIT_DISTANCE) " != " x $( MAC_COMMIT_DISTANCE) " ] ] ; then \
echo " $( COLOR_RED) *** The commit distance for Xamarin.iOS ( $( IOS_COMMIT_DISTANCE) ) and Xamarin.Mac ( $( MAC_COMMIT_DISTANCE) ) are different. $( COLOR_CLEAR) " ; \
echo " $( COLOR_RED) *** To fix this problem, bump the revision (the third number) for both $( COLOR_GRAY) IOS_PACKAGE_NUMBER $( COLOR_RED) and $( COLOR_GRAY) MAC_PACKAGE_NUMBER $( COLOR_RED) in Make.versions. $( COLOR_CLEAR) " ; \
echo " $( COLOR_RED) *** Once fixed, you need to commit the changes for them to pass this check. $( COLOR_CLEAR) " ; \
exit 1; \
elif ( ( $( IOS_COMMIT_DISTANCE) > 999 || $( MAC_COMMIT_DISTANCE) > 999 ) ) ; then \
echo " $( COLOR_RED) *** The commit distance for Xamarin.iOS ( $( IOS_COMMIT_DISTANCE) ) and/or Xamarin.Mac ( $( MAC_COMMIT_DISTANCE) ) are > 999. $( COLOR_CLEAR) " ; \
echo " $( COLOR_RED) *** To fix this problem, bump the revision (the third number) for both $( COLOR_GRAY) IOS_PACKAGE_NUMBER $( COLOR_RED) and $( COLOR_GRAY) MAC_PACKAGE_NUMBER $( COLOR_RED) in Make.versions. $( COLOR_CLEAR) " ; \
echo " $( COLOR_RED) *** Once fixed, you need to commit the changes for them to pass this check. $( COLOR_CLEAR) " ; \
exit 1; \
fi
2020-09-16 18:02:44 +03:00
e n d i f
e n d i f
2016-04-21 14:46:12 +03:00
@./system-dependencies.sh
2022-09-16 19:42:57 +03:00
$( Q) $( MAKE) show-versions
show-versions :
@echo "Building:"
@echo " The .NET NuGet(s):"
@$( foreach platform,$( DOTNET_PLATFORMS) ,echo " Microsoft. $( platform) $( $( shell echo $( platform) | tr 'a-z' 'A-Z' ) _NUGET_VERSION_FULL) " ; )
2016-04-21 14:46:12 +03:00
2017-02-01 16:30:29 +03:00
check-permissions :
i f d e f I N C L U D E _ M A C
@UNREADABLE= ` find $( MAC_DESTDIR) ! -perm -0644` ; if ! test -z " $$ UNREADABLE " ; then echo "There are files with invalid permissions (all installed files at least be readable by everybody, and writable by owner: 0644): " ; find $( MAC_DESTDIR) ! -perm -0644 | xargs ls -la; exit 1; fi
@echo Validated file permissions for Xamarin.Mac.
e n d i f
i f d e f I N C L U D E _ I O S
@UNREADABLE= ` find $( IOS_DESTDIR) ! -perm -0644` ; if ! test -z " $$ UNREADABLE " ; then echo "There are files with invalid permissions (all installed files at least be readable by everybody, and writable by owner: 0644): " ; find $( IOS_DESTDIR) ! -perm -0644 | xargs ls -la; exit 1; fi
@echo Validated file permissions for Xamarin.iOS.
e n d i f
2022-06-07 11:11:02 +03:00
all-local :: global .json
2020-03-06 00:03:38 +03:00
2020-09-21 14:22:44 +03:00
# This tells NuGet to use the exact same dotnet version we've configured in Make.config
2023-10-19 19:22:37 +03:00
global.json : $( TOP ) /dotnet .config Makefile $( GIT_DIRECTORY ) /HEAD $( GIT_DIRECTORY ) /index
2020-09-21 14:22:44 +03:00
$( Q_GEN) \
printf "{\n" > $@ ; \
2024-10-23 19:20:35 +03:00
printf " \"sdk\": {\n \"version\": \" $( DOTNET_VERSION) \"\n },\n " >> $@ ; \
printf " \"tools\": {\n \"dotnet\": \" $( DOTNET_VERSION) \"\n },\n " >> $@ ; \
printf " \"msbuild-sdks\": {\n \"Microsoft.DotNet.Arcade.Sdk\": \" $( ARCADE_VERSION) \"\n }\n " >> $@ ; \
2022-07-08 17:51:15 +03:00
printf "}\n" >> $@
2020-09-21 14:22:44 +03:00
2024-08-06 16:26:32 +03:00
install-hook ::
$( Q) if ! git diff --exit-code global.json; then \
echo "Error: global.json has changed: please commit the changes." ; \
exit 1; \
fi
2016-04-21 14:45:14 +03:00
install-hook ::
2017-02-01 16:30:29 +03:00
@$( MAKE) check-permissions
2016-04-21 14:45:14 +03:00
i f d e f I N C L U D E _ I O S
i f n e q ( $( findstring $ ( IOS_DESTDIR ) $ ( MONOTOUCH_PREFIX ) ,$ ( shell ls -l /Library /Frameworks /Xamarin .iOS .framework /Versions /Current 2>&1) ) , )
@echo
@echo " This build of Xamarin.iOS is the now default version on your system. "
@echo
e l s e
@echo
@echo " Xamarin.iOS has not been installed into your system by 'make install'"
@echo " In order to set the currently built Xamarin.iOS as your system version,"
@echo " execute 'make install-system'" .
@echo
e n d i f
e n d i f
i f d e f I N C L U D E _ M A C
i f n d e f I N C L U D E _ I O S
@echo
e n d i f
i f n e q ( $( findstring $ ( abspath $ ( MAC_DESTDIR ) $ ( MAC_FRAMEWORK_DIR ) /Versions ) ,$ ( shell ls -l $ ( MAC_FRAMEWORK_DIR ) /Versions /Current 2>&1) ) , )
@echo " This build of Xamarin.Mac is the now default version on your system. "
@echo
e l s e
@echo " Xamarin.Mac has not been installed into your system by 'make install'"
@echo " In order to set the currently built Xamarin.Mac as your system version,"
@echo " execute 'make install-system'" .
@echo
e n d i f
e n d i f
2024-10-01 01:23:02 +03:00
$( Q) $( MAKE) -C dotnet shutdown-build-server
2016-04-21 14:45:14 +03:00
2022-09-27 10:49:32 +03:00
.PHONY : package release
package release :
$( Q) $( MAKE) -C $( TOP) /release release
2017-08-30 00:33:43 +03:00
# copy .pkg, .zip and *updateinfo to the packages directory to be uploaded to storage
2022-09-27 10:49:32 +03:00
$( Q) mkdir -p ../package
2022-10-05 09:59:52 +03:00
$( Q) echo "Output from 'make release':"
$( Q) ls -la $( TOP) /release | sed 's/^/ /'
$( Q) if test -n " $$ (shopt -s nullglob; echo $( TOP) /release/*.pkg) " ; then $( CP) $( TOP) /release/*.pkg ../package; fi
$( Q) if test -n " $$ (shopt -s nullglob; echo $( TOP) /release/*.zip) " ; then $( CP) $( TOP) /release/*.zip ../package; fi
$( Q) if test -n " $$ (shopt -s nullglob; echo $( TOP) /release/*updateinfo) " ; then $( CP) $( TOP) /release/*updateinfo ../package; fi
2022-09-27 10:49:32 +03:00
$( Q) echo "Packages:"
$( Q) ls -la ../package | sed 's/^/ /'
2017-08-30 00:33:43 +03:00
2022-07-15 10:58:03 +03:00
dotnet-install-system :
$( Q) $( MAKE) -C dotnet install-system
2016-04-21 14:45:14 +03:00
install-system : install -system -ios install -system -mac
2016-10-13 11:47:46 +03:00
@# Clean up some old files
$( Q) rm -Rf /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS
$( Q) rm -Rf /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Xamarin.ObjcBinding.CSharp.targets
$( Q) rm -Rf /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Xamarin.Common.CSharp.targets
$( Q) rm -Rf /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Xamarin.ObjcBinding.Tasks.dll
2016-10-13 15:11:48 +03:00
$( Q) rm -Rf /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Mac
2016-06-01 15:51:22 +03:00
$( Q) $( MAKE) install-symlinks MAC_DESTDIR = / MAC_INSTALL_VERSION = Current IOS_DESTDIR = / IOS_INSTALL_VERSION = Current -C msbuild V = $( V)
2016-04-21 14:45:14 +03:00
install-system-ios :
2017-08-10 08:21:39 +03:00
i f d e f I N C L U D E _ I O S
2016-04-21 14:45:14 +03:00
@if ! test -s " $( IOS_DESTDIR) / $( MONOTOUCH_PREFIX) /buildinfo " ; then echo "The Xamarin.iOS build seems incomplete. Did you run \"make install\"?" ; exit 1; fi
$( Q) rm -f /Library/Frameworks/Xamarin.iOS.framework/Versions/Current
$( Q) mkdir -p /Library/Frameworks/Xamarin.iOS.framework/Versions
$( Q) ln -s $( IOS_DESTDIR) $( MONOTOUCH_PREFIX) /Library/Frameworks/Xamarin.iOS.framework/Versions/Current
$( Q) echo Installed Xamarin.iOS into /Library/Frameworks/Xamarin.iOS.framework/Versions/Current
2017-08-10 08:21:39 +03:00
e n d i f
2016-04-21 14:45:14 +03:00
install-system-mac :
2017-08-10 08:21:39 +03:00
i f d e f I N C L U D E _ M A C
2016-04-21 14:45:14 +03:00
@if ! test -s " $( MAC_DESTDIR) / $( MAC_FRAMEWORK_CURRENT_DIR) /buildinfo " ; then echo "The Xamarin.Mac build seems incomplete. Did you run \"make install\"?" ; exit 1; fi
$( Q) rm -f $( MAC_FRAMEWORK_DIR) /Versions/Current
$( Q) mkdir -p $( MAC_FRAMEWORK_DIR) /Versions
$( Q) ln -s $( MAC_DESTDIR) $( MAC_FRAMEWORK_CURRENT_DIR) $( MAC_FRAMEWORK_DIR) /Versions/Current
$( Q) echo Installed Xamarin.Mac into $( MAC_FRAMEWORK_DIR) /Versions/Current
2017-08-10 08:21:39 +03:00
e n d i f
2016-04-21 14:45:14 +03:00
fix-install-permissions :
sudo mkdir -p /Library/Frameworks/Mono.framework/External/
sudo mkdir -p /Library/Frameworks/Xamarin.iOS.framework
sudo mkdir -p /Library/Frameworks/Xamarin.Mac.framework
sudo chown -R $( USER) /Library/Frameworks/Mono.framework/External/
sudo chown -R $( USER) /Library/Frameworks/Xamarin.iOS.framework
sudo chown -R $( USER) /Library/Frameworks/Xamarin.Mac.framework
2016-04-21 19:01:11 +03:00
2021-02-23 15:43:21 +03:00
fix-xcode-select :
sudo xcode-select -s $( XCODE_DEVELOPER_ROOT)
2021-04-10 04:41:29 +03:00
fix-xcode-first-run :
$( XCODE_DEVELOPER_ROOT) /usr/bin/xcodebuild -runFirstLaunch
2022-06-07 11:11:02 +03:00
install-dotnet :
@echo "Figuring out package link..."
@export PKG = $$ ( make -C builds print-dotnet-pkg-urls) ; \
echo " Downloading $$ (basename $$ PKG)... " ; \
curl -LO " $$ PKG " ; \
echo " Installing $$ (basename $$ PKG)... " ; \
time sudo installer -pkg " $$ (basename $$ PKG) " -target / -verbose -dumplog
2016-10-04 19:42:57 +03:00
git-clean-all :
2019-01-30 16:25:24 +03:00
@echo " $( COLOR_RED) Cleaning and resetting all dependencies. This is a destructive operation. $( COLOR_CLEAR) "
@echo " $( COLOR_RED) You have 5 seconds to cancel (Ctrl-C) if you wish. $( COLOR_CLEAR) "
2016-10-04 19:42:57 +03:00
@sleep 5
@echo "Cleaning xamarin-macios..."
2019-09-12 10:36:22 +03:00
@git clean -xffdq -e external/mono
@test -d external/mono && echo "Cleaning mono..." && cd external/mono && git clean -xffdq && git submodule foreach -q --recursive 'git clean -xffdq && git reset --hard -q' || true
2019-01-30 16:25:24 +03:00
@git submodule foreach -q --recursive 'git clean -xffdq && git reset --hard -q'
2016-10-04 19:42:57 +03:00
@for dir in $( DEPENDENCY_DIRECTORIES) ; do if test -d $( CURDIR) /$$ dir; then echo " Cleaning $$ dir " && cd $( CURDIR) /$$ dir && git clean -xffdq && git reset --hard -q && git submodule foreach -q --recursive 'git clean -xffdq' ; else echo " Skipped $$ dir (does not exist) " ; fi ; done
2020-11-05 17:58:15 +03:00
2024-11-06 13:34:39 +03:00
@if [ -n " $( ENABLE_XAMARIN) " ] ; then \
2020-11-05 17:58:15 +03:00
CONFIGURE_FLAGS = "" ; \
if [ -n " $( ENABLE_XAMARIN) " ] ; then \
echo "Xamarin-specific build has been re-enabled" ; \
CONFIGURE_FLAGS = " $$ CONFIGURE_FLAGS --enable-xamarin " ; \
fi ; \
./configure " $$ CONFIGURE_FLAGS " ; \
$( MAKE) reset; \
echo "Done" ; \
else \
echo "Done" ; \
fi ; \
2016-10-04 19:42:57 +03:00
2016-06-06 18:13:52 +03:00
SUBDIRS += tests