2018-04-10 10:53:11 +03:00
TOP = ../..
i n c l u d e $( TOP ) / M a k e . c o n f i g
COLOR_GREEN := $( shell tput setaf 120 2>/dev/null)
COLOR_CLEAR := $( shell tput sgr0 2>/dev/null)
2021-03-04 11:07:44 +03:00
i f d e f I N C L U D E _ X A M A R I N _ L E G A C Y
2018-04-10 10:53:11 +03:00
i f d e f E N A B L E _ X A M A R I N
2020-09-16 12:41:44 +03:00
i f d e f I N C L U D E _ M A C
ENABLE_MLAUNCH = 1
e n d i f
e n d i f
2021-03-04 11:07:44 +03:00
e n d i f
2020-09-16 12:41:44 +03:00
2020-10-09 14:01:13 +03:00
DOTNET_PLATFORMS_MOBILE = $( filter-out macOS,$( DOTNET_PLATFORMS) )
2020-09-16 12:41:44 +03:00
i f d e f E N A B L E _ M L A U N C H
2020-11-20 16:41:03 +03:00
build-and-install :
$( MAKE) -C $( MACCORE_PATH) /tools/mlaunch all -j8
$( MAKE) -C $( MACCORE_PATH) /tools/mlaunch install -j8
2018-04-10 10:53:11 +03:00
e l s e
2020-11-20 16:41:03 +03:00
build-and-install :
2018-10-29 18:09:30 +03:00
$( Q) $( CP) -R $( MACIOS_BINARIES_PATH) /mlaunch/bin/mlaunch $( IOS_DESTDIR) /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/bin
$( Q) $( CP) -R $( MACIOS_BINARIES_PATH) /mlaunch/lib/mlaunch $( IOS_DESTDIR) /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib
2020-11-20 16:41:03 +03:00
e n d i f
all-local :: build -and -install
i f d e f E N A B L E _ M L A U N C H
clean-local ::
$( MAKE) -C $( MACCORE_PATH) /tools/mlaunch $@
e n d i f
2020-10-09 14:01:13 +03:00
i f d e f E N A B L E _ D O T N E T
2020-11-20 16:41:03 +03:00
all-local :: build -and -install
2021-01-20 10:16:28 +03:00
$( MAKE) $( foreach platform,$( DOTNET_PLATFORMS_MOBILE) ,$( DOTNET_DESTDIR) /Microsoft.$( platform) .Sdk/tools/bin/mlaunch)
2020-10-09 14:01:13 +03:00
$( Q) for platform in $( DOTNET_PLATFORMS_MOBILE) ; do \
2020-11-20 16:41:03 +03:00
$( CP) -R $( IOS_DESTDIR) /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mlaunch $( DOTNET_DESTDIR) /Microsoft.$$ platform.Sdk/tools/lib; \
2020-10-09 14:01:13 +03:00
done
2021-01-20 10:16:28 +03:00
$(DOTNET_DESTDIR)/Microsoft.%.Sdk/tools/bin/mlaunch : $( IOS_DESTDIR ) /Library /Frameworks /Xamarin .iOS .framework /Versions /Current /bin /mlaunch | $( DOTNET_DESTDIR ) /Microsoft .%.Sdk /tools /bin
$( Q) $( CP) $< $@
$(DOTNET_DESTDIR)/Microsoft.%.Sdk/tools/bin :
$( Q) mkdir -p $@
2020-10-09 14:01:13 +03:00
e n d i f
2018-04-10 10:53:11 +03:00
i f d e f E N A B L E _ X A M A R I N
2020-06-26 11:55:51 +03:00
MACCORE_HASH := $( shell cd $( MACCORE_PATH) && git log -1 --pretty= %h)
2018-04-10 10:53:11 +03:00
publish :
$( Q) mkdir -p $( MACIOS_BINARIES_PATH) /mlaunch/bin
$( Q) mkdir -p $( MACIOS_BINARIES_PATH) /mlaunch/lib
2018-10-29 18:09:30 +03:00
$( Q) $( CP) -R $( IOS_DESTDIR) /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/bin/mlaunch $( MACIOS_BINARIES_PATH) /mlaunch/bin
$( Q) $( CP) -R $( IOS_DESTDIR) /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mlaunch $( MACIOS_BINARIES_PATH) /mlaunch/lib
2020-06-26 11:55:51 +03:00
$( Q) cd $( MACIOS_BINARIES_PATH) && git add mlaunch && git commit -q -m $$ 'Bump mlaunch to xamarin/maccore@$(MACCORE_HASH)\n\nRef: xamarin/maccore@$(MACCORE_HASH)' && git log -1 --pretty= short
2018-04-10 10:53:11 +03:00
$( Q) echo " $( COLOR_GREEN) A new version of mlaunch has been copied to $( MACIOS_BINARIES_PATH) , and a commit created with the new version. $( COLOR_CLEAR) "
$( Q) echo " $( COLOR_GREEN) Please create pull request in the macios-binaries repository for the new mlaunch version, and once merged, bump the submodule in xamarin-macios. $( COLOR_CLEAR) "
e l s e
publish :
@echo "Can't publish mlaunch binaries to the macios-binaries repository unless building mlaunch from source (by enabling the xamarin build)"
@exit 1
e n d i f