2016-04-21 11:59:27 +03:00
TOP = .
2016-06-06 18:13:52 +03:00
SUBDIRS = builds runtime fsharp src tools msbuild
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
#
# Xamarin.iOS
#
IOS_DIRECTORIES += \
$( IOS_DESTDIR) /Library/Frameworks/Xamarin.iOS.framework/Versions \
$( IOS_DESTDIR) /$( MONOTOUCH_PREFIX) \
$( IOS_DESTDIR) /Developer/MonoTouch \
$( IOS_DESTDIR) /Developer/MonoTouch/usr \
$( IOS_DESTDIR) /Developer/MonoTouch/usr/lib/mono \
IOS_TARGETS += \
$( IOS_INSTALL_DIRECTORIES) \
$( IOS_DESTDIR) /Library/Frameworks/Xamarin.iOS.framework/Versions/Current \
$( IOS_DESTDIR) /Developer/MonoTouch/usr/bin \
$( IOS_DESTDIR) /Developer/MonoTouch/usr/lib/mono/2.1 \
$( IOS_DESTDIR) /Developer/MonoTouch/usr/lib/mono/Xamarin.iOS \
$( IOS_DESTDIR) /Developer/MonoTouch/updateinfo \
$( IOS_DESTDIR) /Developer/MonoTouch/Version \
$( IOS_DESTDIR) /Developer/MonoTouch/usr/share \
$( IOS_DESTDIR) /$( MONOTOUCH_PREFIX) /buildinfo \
$( IOS_DESTDIR) /$( MONOTOUCH_PREFIX) /Version \
$( IOS_DESTDIR) /$( MONOTOUCH_PREFIX) /updateinfo \
2016-11-22 16:41:50 +03:00
$( IOS_DESTDIR) /$( MONOTOUCH_PREFIX) /Versions.plist \
2016-04-21 14:45:14 +03:00
$(IOS_DESTDIR)/Library/Frameworks/Xamarin.iOS.framework/Versions/Current : | $( IOS_DESTDIR ) /Library /Frameworks /Xamarin .iOS .framework /Versions
$( Q_LN) ln -hfs $( IOS_INSTALL_VERSION) $@
$(IOS_DESTDIR)/Developer/MonoTouch/usr/bin : | $( IOS_DESTDIR ) /Developer /MonoTouch /usr
$( Q_LN) ln -Fs $( abspath $( IOS_TARGETDIR) /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/bin) $@
$(IOS_DESTDIR)/Developer/MonoTouch/usr/lib/mono/2.1 : | $( IOS_DESTDIR ) /Developer /MonoTouch /usr /lib /mono
$( Q_LN) ln -Fs $( abspath $( IOS_TARGETDIR) /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/2.1) $@
$(IOS_DESTDIR)/Developer/MonoTouch/usr/lib/mono/Xamarin.iOS : | $( IOS_DESTDIR ) /Developer /MonoTouch /usr /lib /mono
$( Q_LN) ln -Fs $( abspath $( IOS_TARGETDIR) /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.iOS) $@
$(IOS_DESTDIR)/Developer/MonoTouch/updateinfo : | $( IOS_DESTDIR ) /Developer /MonoTouch
$( Q_LN) ln -fs $( abspath $( IOS_TARGETDIR) /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/updateinfo) $@
$(IOS_DESTDIR)/Developer/MonoTouch/Version : | $( IOS_DESTDIR ) /Developer /MonoTouch
$( Q_LN) ln -fs $( abspath $( IOS_TARGETDIR) /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/Version) $@
$(IOS_DESTDIR)/Developer/MonoTouch/usr/share : | $( IOS_DESTDIR ) /Developer /MonoTouch /usr
$( Q_LN) ln -Fs $( abspath $( IOS_TARGETDIR) /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/share) $@
2017-05-16 03:13:02 +03:00
$(IOS_DESTDIR)/$(MONOTOUCH_PREFIX)/buildinfo : Make .config .inc .git /index | $( IOS_DESTDIR ) /$( MONOTOUCH_PREFIX )
2016-04-21 14:45:14 +03:00
$( Q_GEN) echo " Version: $( IOS_PACKAGE_VERSION) " > $@
$( Q) echo " Hash: $( shell git log --oneline -1 --pretty= %h) " >> $@
$( Q) echo " Branch: $( CURRENT_BRANCH) " >> $@
$( Q) echo " Build date: $( shell date '+%Y-%m-%d %H:%M:%S%z' ) " >> $@
2017-05-16 03:13:02 +03:00
$(IOS_DESTDIR)/$(MONOTOUCH_PREFIX)/Version : Make .config .inc
2016-04-21 14:45:14 +03:00
$( Q) echo $( IOS_PACKAGE_VERSION) > $@
2017-05-16 03:13:02 +03:00
$(IOS_DESTDIR)/$(MONOTOUCH_PREFIX)/updateinfo : Make .config .inc
2016-04-21 14:45:14 +03:00
$( Q) echo " 4569c276-1397-4adb-9485-82a7696df22e $( IOS_PACKAGE_UPDATE_ID) " > $@
2016-11-22 16:41:50 +03:00
$(IOS_DESTDIR)/$(MONOTOUCH_PREFIX)/Versions.plist : Versions -ios .plist .in Makefile $( TOP ) /Make .config versions -check .csharp
2016-12-13 12:52:58 +03:00
$( Q) ./versions-check.csharp $< " $( MIN_IOS_SDK_VERSION) " " $( IOS_SDK_VERSION) " " $( MIN_TVOS_SDK_VERSION) " " $( TVOS_SDK_VERSION) " " $( MIN_WATCH_OS_VERSION) " " $( WATCH_SDK_VERSION) " " $( MIN_OSX_SDK_VERSION) " " $( OSX_SDK_VERSION) "
2016-11-22 16:41:50 +03:00
$( Q_GEN) sed -e 's/@XCODE_VERSION@/$(XCODE_VERSION)/g' $< > $@
2016-04-21 14:45:14 +03:00
i f d e f I N C L U D E _ I O S
TARGETS += $( IOS_TARGETS)
DIRECTORIES += $( IOS_DIRECTORIES)
e n d i f
#
# Xamarin.Mac
#
MAC_DIRECTORIES += \
$( MAC_DESTDIR) $( MAC_FRAMEWORK_DIR) /Versions \
$( MAC_DESTDIR) /$( MAC_FRAMEWORK_CURRENT_DIR) \
MAC_TARGETS += \
$( MAC_DESTDIR) $( MAC_FRAMEWORK_DIR) /Versions/Current \
$( MAC_DESTDIR) $( MAC_FRAMEWORK_DIR) /Commands \
$( MAC_DESTDIR) /$( MAC_FRAMEWORK_CURRENT_DIR) /buildinfo \
$( MAC_DESTDIR) /$( MAC_FRAMEWORK_CURRENT_DIR) /Version \
$( MAC_DESTDIR) /$( MAC_FRAMEWORK_CURRENT_DIR) /updateinfo \
2016-11-22 16:41:50 +03:00
$( MAC_DESTDIR) /$( MAC_FRAMEWORK_CURRENT_DIR) /Versions.plist \
2016-04-21 14:45:14 +03:00
$(MAC_DESTDIR)$(MAC_FRAMEWORK_DIR)/Versions/Current : | $( MAC_DESTDIR ) $( MAC_FRAMEWORK_DIR ) /Versions
$( Q_LN) ln -hfs $( MAC_INSTALL_VERSION) $@
$(MAC_DESTDIR)$(MAC_FRAMEWORK_DIR)/Commands :
$( Q_LN) ln -hfs $( MAC_TARGETDIR) /Library/Frameworks/Xamarin.Mac.framework/Versions/Current/bin $@
2017-05-16 03:13:02 +03:00
$(MAC_DESTDIR)/$(MAC_FRAMEWORK_CURRENT_DIR)/buildinfo : Make .config .inc .git /index | $( MAC_DESTDIR ) /$( MAC_FRAMEWORK_CURRENT_DIR )
2016-04-21 14:45:14 +03:00
$( Q_GEN) echo " Version: $( MAC_PACKAGE_VERSION) " > $@
$( Q) echo " Hash: $( shell git log --oneline -1 --pretty= %h) " >> $@
$( Q) echo " Branch: $( shell git symbolic-ref --short HEAD) " >> $@
$( Q) echo " Build date: $( shell date '+%Y-%m-%d %H:%M:%S%z' ) " >> $@
2017-05-16 03:13:02 +03:00
$(MAC_DESTDIR)/$(MAC_FRAMEWORK_CURRENT_DIR)/updateinfo : Make .config .inc
2016-04-21 14:45:14 +03:00
$( Q) echo " 0ab364ff-c0e9-43a8-8747-3afb02dc7731 $( MAC_PACKAGE_UPDATE_ID) " > $@
2017-05-16 03:13:02 +03:00
$(MAC_DESTDIR)/$(MAC_FRAMEWORK_CURRENT_DIR)/Version : Make .config .inc
2016-04-21 14:45:14 +03:00
$( Q) echo $( MAC_PACKAGE_VERSION) > $@
2016-11-22 16:41:50 +03:00
$(MAC_DESTDIR)/$(MAC_FRAMEWORK_CURRENT_DIR)/Versions.plist : Versions -mac .plist .in Makefile $( TOP ) /Make .config versions -check .csharp
2016-12-13 12:52:58 +03:00
$( Q) ./versions-check.csharp $< " $( MIN_IOS_SDK_VERSION) " " $( IOS_SDK_VERSION) " " $( MIN_TVOS_SDK_VERSION) " " $( TVOS_SDK_VERSION) " " $( MIN_WATCH_OS_VERSION) " " $( WATCH_SDK_VERSION) " " $( MIN_OSX_SDK_VERSION) " " $( OSX_SDK_VERSION) "
2016-11-22 16:41:50 +03:00
$( Q_GEN) sed -e 's/@XCODE_VERSION@/$(XCODE_VERSION)/g' $< > $@
2016-04-21 14:45:14 +03:00
i f d e f I N C L U D E _ M A C
TARGETS += $( MAC_TARGETS)
DIRECTORIES += $( MAC_DIRECTORIES)
e n d i f
#
# Common
#
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 :
@./system-dependencies.sh
2016-04-21 14:45:14 +03:00
$(DIRECTORIES) :
$( Q) mkdir -p $@
$(TARGETS) : | check -system
all-local :: $( TARGETS )
install-local :: $( TARGETS )
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
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
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-06-04 13:46:52 +03:00
i f d e f E N A B L E _ X A M A R I N
$( Q) $( MAKE) install-symlinks MAC_DESTDIR = / MAC_INSTALL_VERSION = Current IOS_DESTDIR = / IOS_INSTALL_VERSION = Current -C $( MACCORE_PATH) V = $( V)
e n d i f
2016-04-21 14:45:14 +03:00
install-system-ios :
@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
install-system-mac :
@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
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
2016-10-04 19:42:57 +03:00
git-clean-all :
@echo "Cleaning and resetting all dependencies. This is a destructive operation."
@echo "You have 5 seconds to cancel (Ctrl-C) if you wish."
@sleep 5
@echo "Cleaning xamarin-macios..."
@git clean -xffdq
@git submodule foreach -q --recursive 'git clean -xffdq'
@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
i f d e f E N A B L E _ X A M A R I N
@./configure --enable-xamarin
2017-03-30 19:00:32 +03:00
$( MAKE) reset
2016-10-04 19:42:57 +03:00
@echo "Done (Xamarin-specific build has been re-enabled)"
e l s e
@echo "Done"
e n d i f
2016-04-21 19:01:11 +03:00
i f d e f E N A B L E _ X A M A R I N
SUBDIRS += $( MACCORE_PATH)
e n d i f
2016-06-06 18:13:52 +03:00
SUBDIRS += tests