2016-04-21 15:19:32 +03:00
TOP = ..
i n c l u d e $( TOP ) / M a k e . c o n f i g
# without this many compiler warnings about unused functions and variables
# in system headers show up.
export CCACHE_CPP2 = 1
#
# Common
#
SHARED_INC += \
delegates.inc \
SHIPPED_HEADERS += \
xamarin/mono-runtime.h \
xamarin/xamarin.h \
xamarin/main.h \
xamarin/trampolines.h \
xamarin/runtime.h \
2018-01-15 17:08:59 +03:00
xamarin/runtime-generated.h \
2016-04-21 15:19:32 +03:00
SHARED_SOURCES += mono-runtime.m bindings.m bindings-generated.m shared.m runtime.m trampolines.m trampolines-invoke.m xamarin-support.m nsstring-localization.m trampolines-varargs.m
2016-05-11 14:27:51 +03:00
SHARED_I386_SOURCES += trampolines-i386.m trampolines-i386-asm.s trampolines-i386-objc_msgSend.s trampolines-i386-objc_msgSendSuper.s trampolines-i386-objc_msgSend_stret.s trampolines-i386-objc_msgSendSuper_stret.s
SHARED_X86_64_SOURCES += trampolines-x86_64.m trampolines-x86_64-asm.s trampolines-x86_64-objc_msgSend.s trampolines-x86_64-objc_msgSendSuper.s trampolines-x86_64-objc_msgSend_stret.s trampolines-x86_64-objc_msgSendSuper_stret.s
2019-05-07 08:35:39 +03:00
SHARED_ARM64_SOURCES += trampolines-arm64.m trampolines-arm64-asm.s
2016-04-21 15:19:32 +03:00
SHARED_HEADERS += shared.h product.h delegates.h runtime-internal.h $( SHARED_INC) $( SHIPPED_HEADERS) trampolines-internal.h slinked-list.h
2019-05-07 08:35:39 +03:00
SHARED_FILES = $( SHARED_SOURCES) $( SHARED_HEADERS) $( SHARED_I386_SOURCES) $( SHARED_X86_64_SOURCES) $( SHARED_ARM64_SOURCES)
2016-04-21 15:19:32 +03:00
Bump to mono:2019-06 (#6196)
* Use the commonly used casing for `MSBuildSDKsPath` property
Handle "incorrectly" cased msbuild property names
msbuild property names are case insensitive. While generating the custom
app.config, in `SetToolsetProperty(..)` we try to update the property if
it already exists. But the name lookup was case sensitive, thus causing
the lookup to fail, resulting in two entries for the same property name
differing only in case. Eg. `MSBuildSDKsPath` vs `MSBuildSdksPath`.
* [mtouch] Whitelist new Brotli native symbols in Xamarin.Tests.Misc.PublicSymbols test
* [mtouch] Better assert in NoLLVMFailuresInWatchOS() test
We'd list the "LLVM failed" messages before even though the AOT might've crashed and the list is meaningless. Assert the exit code before that.
* [mtouch] Use new LLVM even for 32bit targets
See https://github.com/mono/mono/issues/14841 and https://github.com/mono/mono/issues/9621
* [mtouch] Work around slow LLVM in "don't link" test
See https://github.com/mono/mono/issues/14843
* Remove useless conditional
* Remove LLVM36 from Makefile
* [watch4] set right min version for arm64_32 based watch devices (#6307)
Fixes the confusion around `libmono-native*` (see for example https://github.com/xamarin/xamarin-macios/commit/ce5ba1e41d526eddd9b61f68fae22a747831e9f2#commitcomment-33834491 ) when building with `MONO_BUILD_FROM_SOURCE=1`.
* reflect watchos64_32_version_min change from mono sdk
* Move mono hash info to mk/mono.mk so that existing scripts work.
* Add Makefile dependency on mono.mk where necessary
With https://github.com/xamarin/xamarin-macios/commit/3e7bc29adec8dff3558c284a3050f2db36ea3cf2 the Mono hash was moved from Make.config to mono.mk.
We need to add a Makefile dependency on this file wherever Make.config was used to track a Mono dependency.
* [tests] Copy mk/mono.mk to the XM test package.
* [tests] Update minOS version test after consolidating min watchOS versions everywhere.
Fixes this mtouch and mmptest failure:
1) Failed : Xamarin.Tests.ProductTests.MinOSVersion(watchOS,MinwatchOS,WatchOSSimulator,False)
Failures
Expected: <empty>
But was: < "Unexpected minOS version (expected 2.0.0, alternatively 2.0.0, found 5.1.0) in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/SDKs/Xamarin.WatchSimulator.sdk/usr/lib/libxamarin-debug.a (mono-runtime-debug.arm64_32.o).", "Unexpected minOS version (expected 2.0.0, alternatively 2.0.0, found 5.1.0) in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/SDKs/Xamarin.WatchSimulator.sdk/usr/lib/libxamarin-debug.a (bindings-debug.arm64_32.o).", "Unexpected minOS version (expected 2.0.0, alternatively 2.0.0, found 5.1.0) in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/SDKs/Xamarin.WatchSimulator.sdk/usr/lib/libxamarin-debug.a (bindings-generated-debug.arm64_32.o).", "Unexpected minOS version (expected 2.0.0, alternatively 2.0.0, found 5.1.0) in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/SDKs/Xamarin.WatchSimulator.sdk/usr/lib/libxamarin-debug.a (shared-debug.arm64_32.o).", "Unexpected minOS version (expected 2.0.0, alternatively 2.0.0, found 5.1.0) in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/SDKs/Xamarin.WatchSimulator.sdk/usr/lib/libxamarin-debug.a (runtime-debug.arm64_32.o).", "Unexpected minOS version (expected 2.0.0, alternatively 2.0.0, found 5.1.0) in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/SDKs/Xamarin.WatchSimulator.sdk/usr/lib/libxamarin-debug.a (trampolines-debug.arm64_32.o).", "Unexpected minOS version (expected 2.0.0, alternatively 2.0.0, found 5.1.0) in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/SDKs/Xamarin.WatchSimulator.sdk/usr/lib/libxamarin-debug.a (trampolines-invoke-debug.arm64_32.o).", "Unexpected minOS version (expected 2.0.0, alternatively 2.0.0, found 5.1.0) in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/SDKs/Xamarin.WatchSimulator.sdk/usr/lib/libxamarin-debug.a (xamarin-support-debug.arm64_32.o).", "Unexpected minOS version (expected 2.0.0, alternatively 2.0.0, found 5.1.0) in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/SDKs/Xamarin.WatchSimulator.sdk/usr/lib/libxamarin-debug.a (nsstring-localization-debug.arm64_32.o).", "Unexpected minOS version (expected 2.0.0, alternatively 2.0.0, found 5.1.0) in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/SDKs/Xamarin.WatchSimulator.sdk/usr/lib/libxamarin-debug.a (trampolines-varargs-debug.arm64_32.o)."... >
* [mmp] Fix make clean target
It needs an -r to remove directories:
```
rm: bin: is a directory
rm: obj: is a directory
```
* Add new xamarin_timezone_get_local_name() to a few more places
2019-07-16 18:24:00 +03:00
EXTRA_DEPENDENCIES = $( SHARED_HEADERS) $( TOP) /Make.config $( TOP) /mk/mono.mk
2016-04-21 15:19:32 +03:00
2020-02-14 16:25:43 +03:00
i f d e f I N J E C T _ X 8 6 _ 6 4 _ S L I C E
2019-09-09 10:34:11 +03:00
X86_64_SLICE = $( abspath $( CURDIR) /x86-64-slice.dylib)
$(X86_64_SLICE) : Makefile
2019-09-18 12:00:44 +03:00
$( Q) echo "void xamarin_x86_64_function_for_notarization_workaround_v2 () {}" | $( MAC_CC) -shared -x c -o$@ -
2020-02-14 16:25:43 +03:00
e l s e
X86_64_SLICE =
e n d i f
2019-09-09 10:34:11 +03:00
2016-04-21 15:19:32 +03:00
xamarin/mono-runtime.h : mono -runtime .h .t 4 exports .t 4
$( Q_GEN) $( TT) $< -o $@
2018-01-15 17:08:59 +03:00
xamarin/runtime-generated.h : runtime -generated .h .t 4 delegates .t 4
$( Q_GEN) $( TT) $< -o $@
2016-04-21 15:19:32 +03:00
mono-runtime.m : mono -runtime .m .t 4 exports .t 4
$( Q_GEN) $( TT) $< -o $@
delegates.% : delegates .%.t 4 delegates .t 4
$( Q_GEN) $( TT) $< -o $@
Delegates.generated.cs : Delegates .cs .t 4 delegates .t 4
$( Q_GEN) $( TT) $< -o $@
bindings-generator.exe : bindings -generator .cs
2020-01-02 21:57:22 +03:00
$( Q) $( SYSTEM_CSC) $< -out:$@ -debug:full -features:strict
2016-04-21 15:19:32 +03:00
bindings-generated.m : bindings -generator .exe
$( Q_GEN) $( SYSTEM_MONO) --debug $< $@
# our makefiles don't support building the same source file multiple times with different defines,
# so just symlink extension-main.m to another file and compile that instead.
2016-04-26 00:27:10 +03:00
app-main.m watchextension-main.m tvextension-main.m : extension -main .m
2016-04-21 15:19:32 +03:00
$( Q_LN) ln -fs $< $@
#
# MonoTouch defines (used for all MonoTouch platforms: iOS, WatchOS and TVOS)
#
MONOTOUCH_SOURCES = \
monotouch-debug.m \
monotouch-main.m \
MONOTOUCH_HEADERS = \
monotouch-debug.h \
MONOTOUCH_LIBS = \
libextension.a \
libwatchextension.a \
2016-04-26 00:27:10 +03:00
libtvextension.a \
2016-04-21 15:19:32 +03:00
libapp.a \
libxamarin.a \
libxamarin-debug.a \
libxamarin.dylib \
libxamarin-debug.dylib \
2016-11-16 21:05:38 +03:00
MONOTOUCH_FRAMEWORKS = \
Xamarin \
Xamarin-debug \
2018-10-23 02:52:45 +03:00
MONOTOUCH_SOURCE_STEMS = $( patsubst %.s,%,$( patsubst %.m,%,$( SHARED_SOURCES) $( MONOTOUCH_SOURCES) ) )
2016-04-21 15:19:32 +03:00
MONOTOUCH_I386_SOURCE_STEMS = $( patsubst %.s,%,$( patsubst %.m,%,$( SHARED_I386_SOURCES) ) )
MONOTOUCH_X86_64_SOURCE_STEMS = $( patsubst %.s,%,$( patsubst %.m,%,$( SHARED_X86_64_SOURCES) ) )
2019-05-07 08:35:39 +03:00
MONOTOUCH_ARM64_SOURCE_STEMS = $( patsubst %.s,%,$( patsubst %.m,%,$( SHARED_ARM64_SOURCES) ) )
2016-04-21 15:19:32 +03:00
#
# PlatformTemplate contains the install targets and sets up some variables
#
d e f i n e P l a t f o r m T e m p l a t e
$(2)_SOURCES = $( MONOTOUCH_SOURCES)
$(2)_HEADERS = $( MONOTOUCH_HEADERS)
$(2)_SOURCE_STEMS = $( MONOTOUCH_SOURCE_STEMS)
$(2)_X86_64_SOURCE_STEMS = $( MONOTOUCH_X86_64_SOURCE_STEMS)
$(2)_I386_SOURCE_STEMS = $( MONOTOUCH_I386_SOURCE_STEMS)
2019-05-07 08:35:39 +03:00
$(2)_ARM64_SOURCE_STEMS = $( MONOTOUCH_ARM64_SOURCE_STEMS)
2016-04-21 15:19:32 +03:00
$(2)_LIBRARIES = $( MONOTOUCH_LIBS)
2019-10-03 17:38:44 +03:00
$(2)_ARCHITECTURES = $( 3)
2016-11-16 21:05:38 +03:00
$(2)_FRAMEWORKS = $( MONOTOUCH_FRAMEWORKS)
2016-04-21 15:19:32 +03:00
RUNTIME_$(2)_TARGETS_DIRS += \
2019-10-03 17:38:44 +03:00
$( IOS_DESTDIR) $$ ( XAMARIN_$( 2) _SDK) /Frameworks/Xamarin.framework \
$( IOS_DESTDIR) $$ ( XAMARIN_$( 2) _SDK) /Frameworks/Xamarin-debug.framework \
2020-04-16 15:19:45 +03:00
$( IOS_DESTDIR) $$ ( XAMARIN_$( 2) _SDK) /lib \
$( IOS_DESTDIR) $$ ( XAMARIN_$( 2) _SDK) /include/xamarin \
2016-05-19 15:33:35 +03:00
RUNTIME_$(2)_TARGETS += \
2019-10-03 17:38:44 +03:00
$$ ( foreach file,$$ ( $( 2) _FRAMEWORKS) ,$( IOS_DESTDIR) $$ ( XAMARIN_$( 2) _SDK) /Frameworks/$$ ( file) .framework/$$ ( file) ) \
$$ ( foreach file,$$ ( $( 2) _FRAMEWORKS) ,$( IOS_DESTDIR) $$ ( XAMARIN_$( 2) _SDK) /Frameworks/$$ ( file) .framework/Info.plist) \
$$ ( foreach file,$$ ( $( 2) _FRAMEWORKS) ,$( IOS_DESTDIR) $$ ( XAMARIN_$( 2) _SDK) /Frameworks/$$ ( file) .framework.dSYM/Contents/Info.plist) \
2020-04-16 15:19:45 +03:00
$$ ( foreach file,$$ ( $( 2) _LIBRARIES) ,$( IOS_DESTDIR) $$ ( XAMARIN_$( 2) _SDK) /lib/$$ ( file) ) \
$( foreach file,$( SHIPPED_HEADERS) ,$( IOS_DESTDIR) $$ ( XAMARIN_$( 2) _SDK) /include/$( file) ) \
2016-05-19 15:33:35 +03:00
2020-04-16 15:19:45 +03:00
$(IOS_DESTDIR)$$(XAMARIN_$(2)_SDK)/lib/%.a : .libs /$( 1) /%.a | $( IOS_DESTDIR ) $$( XAMARIN_ $ ( 2) _SDK ) /lib
2016-04-21 15:19:32 +03:00
$( Q) install -m 0644 $$ < $$ @
2019-10-03 17:38:44 +03:00
$(IOS_DESTDIR)$$(XAMARIN_$(2)_SDK)/Frameworks/Xamarin.framework/Xamarin : .libs /$( 1) /Xamarin .framework | $( IOS_DESTDIR ) $$( XAMARIN_ $ ( 2) _SDK ) /Frameworks /Xamarin .framework
2018-10-29 18:09:30 +03:00
$( Q) $( CP) $$ < $$ @
2017-04-03 12:52:29 +03:00
2019-10-03 17:38:44 +03:00
$(IOS_DESTDIR)$$(XAMARIN_$(2)_SDK)/Frameworks/Xamarin-debug.framework/Xamarin-debug : .libs /$( 1) /Xamarin -debug .framework | $( IOS_DESTDIR ) $$( XAMARIN_ $ ( 2) _SDK ) /Frameworks /Xamarin -debug .framework
2018-10-29 18:09:30 +03:00
$( Q) $( CP) $$ < $$ @
2016-11-16 21:05:38 +03:00
2019-10-03 17:38:44 +03:00
$(IOS_DESTDIR)$$(XAMARIN_$(2)_SDK)/Frameworks/%.framework/Info.plist : Xamarin .framework -$( 1) .Info .plist | $( IOS_DESTDIR ) $$( XAMARIN_ $ ( 2) _SDK ) /Frameworks /%.framework
2016-11-16 21:05:38 +03:00
$( Q) sed 's/@BUNDLE_EXECUTABLE@/$$*/' $$ < > $$ @
2019-10-03 17:38:44 +03:00
$(IOS_DESTDIR)$$(XAMARIN_$(2)_SDK)/Frameworks/Xamarin.framework.dSYM/Contents/Info.plist : $( IOS_DESTDIR ) $$( XAMARIN_ $ ( 2) _SDK ) /Frameworks /Xamarin .framework /Xamarin $( IOS_DESTDIR ) $$( XAMARIN_ $ ( 2) _SDK ) /Frameworks /Xamarin .framework /Info .plist
2019-09-18 15:19:17 +03:00
$$ ( Q_GEN) dsymutil -j 4 $$ < -o $$ ( abspath $$ ( dir $$ <) /..) /Xamarin.framework.dSYM
2019-10-03 17:38:44 +03:00
$(IOS_DESTDIR)$$(XAMARIN_$(2)_SDK)/Frameworks/Xamarin-debug.framework.dSYM/Contents/Info.plist : $( IOS_DESTDIR ) $$( XAMARIN_ $ ( 2) _SDK ) /Frameworks /Xamarin -debug .framework /Xamarin -debug $( IOS_DESTDIR ) $$( XAMARIN_ $ ( 2) _SDK ) /Frameworks /Xamarin -debug .framework /Info .plist
2019-09-18 15:19:17 +03:00
$$ ( Q_GEN) dsymutil -j 4 $$ < -o $$ ( abspath $$ ( dir $$ <) /..) /Xamarin-debug.framework.dSYM
2020-04-16 15:19:45 +03:00
$(IOS_DESTDIR)$$(XAMARIN_$(2)_SDK)/lib/%.dylib : .libs /$( 1) /%.dylib | $( IOS_DESTDIR ) $$( XAMARIN_ $ ( 2) _SDK ) /lib
2019-10-03 17:38:44 +03:00
$$ ( Q_STRIP) $( DEVICE_BIN_PATH) /bitcode_strip $$ < -m -o $$ @
2016-04-21 15:19:32 +03:00
2020-04-16 15:19:45 +03:00
$(IOS_DESTDIR)$$(XAMARIN_$(2)_SDK)/include/%.h : %.h | $( IOS_DESTDIR ) $$( XAMARIN_ $ ( 2) _SDK ) /include /xamarin
2016-04-21 15:19:32 +03:00
$( Q) install -m 0644 $$ < $$ @
2019-10-03 17:38:44 +03:00
.libs/$(1)/Xamarin.framework : $$( foreach arch ,$ $ ( $ ( 2) _ARCHITECTURES ) ,.libs /$ ( 1) /Xamarin .$ $ ( arch ) .framework )
$( Q) rm -f $$ @
i f e q ( 1 , $$ ( w o r d s $$ ( $( 2) _ A R C H I T E C T U R E S ) ) )
$( Q) $( CP) $$ ^ $$ @
Remove unnecessary bitcode from dylibs. Fixes #51352 (#1469)
This is a series of fixes to the dynamic libraries we build / create to remove
any unnecessary bloat (unused architectures, bitcode).
A brand new watchOS app with no changes goes from 35MB to 11MB with these
fixes (with incremental builds disabled, the app size is 10MB).
--------------------------------------------------------------------------------
* [runtime] Split list of architectures into simulator and device-specific lists.
* [runtime] Build separate dylibs for device and simulator.
Build separate dylibs for device and simulator, since we already install these
into different locations.
This makes both the simulator and device builds slightly faster (since the
respective dylibs are smaller, and less data to copy around).
For watchOS apps, this saves ~430kb.
* [runtime] Strip bitcode from dylibs. Fixes #51352.
We know that dylibs will never be shipped to the App Store, so we'll never
need them to have bitcode.
So just strip the bitcode from all our dylibs, since this makes apps with
fastdev significantly smaller (and thus much faster to upload to watch
devices).
For watchOS apps this is a very significant improvement: a branch new watchOS
app without any changes goes from 35MB to 17MB.
https://bugzilla.xamarin.com/show_bug.cgi?id=51352
* [mtouch] Fix dylib compilation to not embed full bitcode.
Facts
=====
a. The output from the AOT compiler is an assembly (.s) file.
b. Clang's assembler does not support -fembed-bitcode-marker (only -fembed-
bitcode), so when we ask clang to -fembed-bitcode-marker, the assembler
receives a -fembed-bitcode argument.
c. This means that the assembled object file does not contain the
__LLVM/__bitcode and __LLVM/__cmdline sections (it does however contain an
__LLVM/__asm section).
d. The native linker will create a bitcode assembly section if none of the
object files passed to the linker contain a __LLVM/__bitcode section and
there's an __LLVM/__asm section present.
e. The end result is that when we build to a dylib, we end up (unexpectedly,
because we ask Clang to -fembed-bitcode-marker) including both armv7k and
bitcode in the dylib, thus bloating the dylib size significantly.
Solution
========
We manually add the __LLVM/__bitcode and __LLVM/__cmdline sections to the .s
file Mono's AOT compiler generated. This way the .o file will have the magic
sections, and the linker will not include bitcode (only the bitcode marker) in
the final library.
An empty watchOS extension with incremental builds is now 6MB smaller (down
to 11MB from 17MB).
2017-01-16 14:32:06 +03:00
e l s e
2019-10-03 17:38:44 +03:00
$$ ( call Q_2,LIPO, [ $1 ] ) $( DEVICE_BIN_PATH) /lipo $$ ^ -create -output $$ @
Remove unnecessary bitcode from dylibs. Fixes #51352 (#1469)
This is a series of fixes to the dynamic libraries we build / create to remove
any unnecessary bloat (unused architectures, bitcode).
A brand new watchOS app with no changes goes from 35MB to 11MB with these
fixes (with incremental builds disabled, the app size is 10MB).
--------------------------------------------------------------------------------
* [runtime] Split list of architectures into simulator and device-specific lists.
* [runtime] Build separate dylibs for device and simulator.
Build separate dylibs for device and simulator, since we already install these
into different locations.
This makes both the simulator and device builds slightly faster (since the
respective dylibs are smaller, and less data to copy around).
For watchOS apps, this saves ~430kb.
* [runtime] Strip bitcode from dylibs. Fixes #51352.
We know that dylibs will never be shipped to the App Store, so we'll never
need them to have bitcode.
So just strip the bitcode from all our dylibs, since this makes apps with
fastdev significantly smaller (and thus much faster to upload to watch
devices).
For watchOS apps this is a very significant improvement: a branch new watchOS
app without any changes goes from 35MB to 17MB.
https://bugzilla.xamarin.com/show_bug.cgi?id=51352
* [mtouch] Fix dylib compilation to not embed full bitcode.
Facts
=====
a. The output from the AOT compiler is an assembly (.s) file.
b. Clang's assembler does not support -fembed-bitcode-marker (only -fembed-
bitcode), so when we ask clang to -fembed-bitcode-marker, the assembler
receives a -fembed-bitcode argument.
c. This means that the assembled object file does not contain the
__LLVM/__bitcode and __LLVM/__cmdline sections (it does however contain an
__LLVM/__asm section).
d. The native linker will create a bitcode assembly section if none of the
object files passed to the linker contain a __LLVM/__bitcode section and
there's an __LLVM/__asm section present.
e. The end result is that when we build to a dylib, we end up (unexpectedly,
because we ask Clang to -fembed-bitcode-marker) including both armv7k and
bitcode in the dylib, thus bloating the dylib size significantly.
Solution
========
We manually add the __LLVM/__bitcode and __LLVM/__cmdline sections to the .s
file Mono's AOT compiler generated. This way the .o file will have the magic
sections, and the linker will not include bitcode (only the bitcode marker) in
the final library.
An empty watchOS extension with incremental builds is now 6MB smaller (down
to 11MB from 17MB).
2017-01-16 14:32:06 +03:00
e n d i f
2016-04-21 15:19:32 +03:00
2019-10-03 17:38:44 +03:00
.libs/$(1)/Xamarin-debug.framework : $$( foreach arch ,$ $ ( $ ( 2) _ARCHITECTURES ) ,.libs /$ ( 1) /Xamarin -debug .$ $ ( arch ) .framework )
$( Q) rm -f $$ @
i f e q ( 1 , $$ ( w o r d s $$ ( $( 2) _ A R C H I T E C T U R E S ) ) )
$( Q) $( CP) $$ ^ $$ @
e l s e
$$ ( call Q_2,LIPO, [ $1 ] ) $( DEVICE_BIN_PATH) /lipo $$ ^ -create -output $$ @
2016-05-19 15:33:35 +03:00
e n d i f
2016-04-21 15:19:32 +03:00
$$ (RUNTIME_$(2)_TARGETS_DIRS) :
$( Q) mkdir -p $$ @
2019-10-03 17:38:44 +03:00
all-$(2) :: $$( RUNTIME_ $ ( 2) _TARGETS )
2016-04-21 15:19:32 +03:00
all-local :: $$( RUNTIME_ $ ( 2) _TARGETS )
install-local :: $$( RUNTIME_ $ ( 2) _TARGETS )
e n d e f
2019-10-03 17:38:44 +03:00
# 1: platform
2016-04-21 15:19:32 +03:00
# 2: variable prefix
2019-10-03 17:38:44 +03:00
# 3: architectures
2016-04-21 15:19:32 +03:00
i f d e f I N C L U D E _ I O S
2019-10-03 17:38:44 +03:00
i f d e f I N C L U D E _ D E V I C E
$( eval $ ( call PlatformTemplate ,iphoneos ,IPHONEOS ,armv 7 armv 7s arm 64) )
e n d i f
$( eval $ ( call PlatformTemplate ,iphonesimulator ,IOSSIMULATOR ,x 86 x 86_ 64) )
2016-04-21 15:19:32 +03:00
e n d i f
i f d e f I N C L U D E _ W A T C H
2019-10-03 17:38:44 +03:00
i f d e f I N C L U D E _ D E V I C E
$( eval $ ( call PlatformTemplate ,watchos ,WATCHOS ,armv 7k arm 64_ 32) )
e n d i f
$( eval $ ( call PlatformTemplate ,watchsimulator ,WATCHSIMULATOR ,x 86) )
2016-04-21 15:19:32 +03:00
e n d i f
i f d e f I N C L U D E _ T V O S
2019-10-03 17:38:44 +03:00
i f d e f I N C L U D E _ D E V I C E
$( eval $ ( call PlatformTemplate ,tvos ,TVOS ,arm 64) )
e n d i f
$( eval $ ( call PlatformTemplate ,tvsimulator ,TVSIMULATOR ,x 86_ 64) )
2016-04-21 15:19:32 +03:00
e n d i f
#
# LibTemplate we build three different libraries from the same source code,
# libapp.a, libextension.a and libwatchextension.a.
#
# They're all built from the same soure file (extension-main.m), but with different defines:
# libextension.a has EXTENSION defined, while libwatchextension.a has WATCH_EXTENSION defined.
#
d e f i n e L i b T e m p l a t e
$$ (foreach arch,$$($(2)_ARCHITECTURES),.libs/$(1)/extension-main.$$(arch).o) : EXTRA_DEFINES =-DEXTENSION
$$ (foreach arch,$$($(2)_ARCHITECTURES),.libs/$(1)/watchextension-main.$$(arch).o) : EXTRA_DEFINES =-DWATCH_EXTENSION
2016-04-26 00:27:10 +03:00
$$ (foreach arch,$$($(2)_ARCHITECTURES),.libs/$(1)/tvextension-main.$$(arch).o) : EXTRA_DEFINES =-DTV_EXTENSION
2016-04-21 15:19:32 +03:00
.libs/$(1)/libextension.%.a : .libs /$( 1) /extension -main .%.o
$( Q) rm -f $$ @
$$ ( call Q_2,AR, [ $1 ] ) $( DEVICE_BIN_PATH) /ar cru $$ @ $$ ^
.libs/$(1)/libapp.%.a : .libs /$( 1) /app -main .%.o
$( Q) rm -f $$ @
$$ ( call Q_2,AR, [ $1 ] ) $( DEVICE_BIN_PATH) /ar cru $$ @ $$ ^
.libs/$(1)/libextension.a : $$( foreach arch ,$ $ ( $ ( 2) _ARCHITECTURES ) ,.libs /$ ( 1) /libextension .$ $ ( arch ) .a )
$( Q) rm -f $$ @
$$ ( call Q_2,LIPO, [ $1 ] ) $( DEVICE_BIN_PATH) /lipo $$ ^ -create -output $$ @
.libs/$(1)/libapp.a : $$( foreach arch ,$ $ ( $ ( 2) _ARCHITECTURES ) ,.libs /$ ( 1) /libapp .$ $ ( arch ) .a )
$( Q) rm -f $$ @
$$ ( call Q_2,LIPO, [ $1 ] ) $( DEVICE_BIN_PATH) /lipo $$ ^ -create -output $$ @
.libs/$(1)/libwatchextension.%.a : .libs /$( 1) /watchextension -main .%.o
$( Q) rm -f $$ @
$$ ( call Q_2,AR, [ $1 ] ) $( DEVICE_BIN_PATH) /ar cru $$ @ $$ ^
.libs/$(1)/libwatchextension.a : $$( foreach arch ,$ $ ( $ ( 2) _ARCHITECTURES ) ,.libs /$ ( 1) /libwatchextension .$ $ ( arch ) .a )
$( Q) rm -f $$ @
$$ ( call Q_2,LIPO, [ $1 ] ) $( DEVICE_BIN_PATH) /lipo $$ ^ -create -output $$ @
2016-04-26 00:27:10 +03:00
.libs/$(1)/libtvextension.%.a : .libs /$( 1) /tvextension -main .%.o
$( Q) rm -f $$ @
$$ ( call Q_2,AR, [ $1 ] ) $( DEVICE_BIN_PATH) /ar cru $$ @ $$ ^
.libs/$(1)/libtvextension.a : $$( foreach arch ,$ $ ( $ ( 2) _ARCHITECTURES ) ,.libs /$ ( 1) /libtvextension .$ $ ( arch ) .a )
$( Q) rm -f $$ @
$$ ( call Q_2,LIPO, [ $1 ] ) $( DEVICE_BIN_PATH) /lipo $$ ^ -create -output $$ @
2019-10-03 17:38:44 +03:00
.libs/$(1)/libxamarin.dylib : $$( foreach arch ,$ $ ( $ ( 2) _ARCHITECTURES ) ,.libs /$ ( 1) /libxamarin .$ $ ( arch ) .dylib )
Remove unnecessary bitcode from dylibs. Fixes #51352 (#1469)
This is a series of fixes to the dynamic libraries we build / create to remove
any unnecessary bloat (unused architectures, bitcode).
A brand new watchOS app with no changes goes from 35MB to 11MB with these
fixes (with incremental builds disabled, the app size is 10MB).
--------------------------------------------------------------------------------
* [runtime] Split list of architectures into simulator and device-specific lists.
* [runtime] Build separate dylibs for device and simulator.
Build separate dylibs for device and simulator, since we already install these
into different locations.
This makes both the simulator and device builds slightly faster (since the
respective dylibs are smaller, and less data to copy around).
For watchOS apps, this saves ~430kb.
* [runtime] Strip bitcode from dylibs. Fixes #51352.
We know that dylibs will never be shipped to the App Store, so we'll never
need them to have bitcode.
So just strip the bitcode from all our dylibs, since this makes apps with
fastdev significantly smaller (and thus much faster to upload to watch
devices).
For watchOS apps this is a very significant improvement: a branch new watchOS
app without any changes goes from 35MB to 17MB.
https://bugzilla.xamarin.com/show_bug.cgi?id=51352
* [mtouch] Fix dylib compilation to not embed full bitcode.
Facts
=====
a. The output from the AOT compiler is an assembly (.s) file.
b. Clang's assembler does not support -fembed-bitcode-marker (only -fembed-
bitcode), so when we ask clang to -fembed-bitcode-marker, the assembler
receives a -fembed-bitcode argument.
c. This means that the assembled object file does not contain the
__LLVM/__bitcode and __LLVM/__cmdline sections (it does however contain an
__LLVM/__asm section).
d. The native linker will create a bitcode assembly section if none of the
object files passed to the linker contain a __LLVM/__bitcode section and
there's an __LLVM/__asm section present.
e. The end result is that when we build to a dylib, we end up (unexpectedly,
because we ask Clang to -fembed-bitcode-marker) including both armv7k and
bitcode in the dylib, thus bloating the dylib size significantly.
Solution
========
We manually add the __LLVM/__bitcode and __LLVM/__cmdline sections to the .s
file Mono's AOT compiler generated. This way the .o file will have the magic
sections, and the linker will not include bitcode (only the bitcode marker) in
the final library.
An empty watchOS extension with incremental builds is now 6MB smaller (down
to 11MB from 17MB).
2017-01-16 14:32:06 +03:00
$( Q) rm -f $$ @
2019-10-03 17:38:44 +03:00
i f e q ( 1 , $$ ( w o r d s $$ ( $( 2) _ A R C H I T E C T U R E S ) ) )
$( Q) $( CP) $$ ^ $$ @
e l s e
Remove unnecessary bitcode from dylibs. Fixes #51352 (#1469)
This is a series of fixes to the dynamic libraries we build / create to remove
any unnecessary bloat (unused architectures, bitcode).
A brand new watchOS app with no changes goes from 35MB to 11MB with these
fixes (with incremental builds disabled, the app size is 10MB).
--------------------------------------------------------------------------------
* [runtime] Split list of architectures into simulator and device-specific lists.
* [runtime] Build separate dylibs for device and simulator.
Build separate dylibs for device and simulator, since we already install these
into different locations.
This makes both the simulator and device builds slightly faster (since the
respective dylibs are smaller, and less data to copy around).
For watchOS apps, this saves ~430kb.
* [runtime] Strip bitcode from dylibs. Fixes #51352.
We know that dylibs will never be shipped to the App Store, so we'll never
need them to have bitcode.
So just strip the bitcode from all our dylibs, since this makes apps with
fastdev significantly smaller (and thus much faster to upload to watch
devices).
For watchOS apps this is a very significant improvement: a branch new watchOS
app without any changes goes from 35MB to 17MB.
https://bugzilla.xamarin.com/show_bug.cgi?id=51352
* [mtouch] Fix dylib compilation to not embed full bitcode.
Facts
=====
a. The output from the AOT compiler is an assembly (.s) file.
b. Clang's assembler does not support -fembed-bitcode-marker (only -fembed-
bitcode), so when we ask clang to -fembed-bitcode-marker, the assembler
receives a -fembed-bitcode argument.
c. This means that the assembled object file does not contain the
__LLVM/__bitcode and __LLVM/__cmdline sections (it does however contain an
__LLVM/__asm section).
d. The native linker will create a bitcode assembly section if none of the
object files passed to the linker contain a __LLVM/__bitcode section and
there's an __LLVM/__asm section present.
e. The end result is that when we build to a dylib, we end up (unexpectedly,
because we ask Clang to -fembed-bitcode-marker) including both armv7k and
bitcode in the dylib, thus bloating the dylib size significantly.
Solution
========
We manually add the __LLVM/__bitcode and __LLVM/__cmdline sections to the .s
file Mono's AOT compiler generated. This way the .o file will have the magic
sections, and the linker will not include bitcode (only the bitcode marker) in
the final library.
An empty watchOS extension with incremental builds is now 6MB smaller (down
to 11MB from 17MB).
2017-01-16 14:32:06 +03:00
$$ ( call Q_2,LIPO, [ $1 ] ) $( DEVICE_BIN_PATH) /lipo $$ ^ -create -output $$ @
2019-10-03 17:38:44 +03:00
e n d i f
2017-01-24 22:24:32 +03:00
$( Q) install_name_tool -id @rpath/libxamarin.dylib $$ @
$( Q) install_name_tool -change @rpath/ @rpath/libmonosgen-2.0.dylib $$ @
Remove unnecessary bitcode from dylibs. Fixes #51352 (#1469)
This is a series of fixes to the dynamic libraries we build / create to remove
any unnecessary bloat (unused architectures, bitcode).
A brand new watchOS app with no changes goes from 35MB to 11MB with these
fixes (with incremental builds disabled, the app size is 10MB).
--------------------------------------------------------------------------------
* [runtime] Split list of architectures into simulator and device-specific lists.
* [runtime] Build separate dylibs for device and simulator.
Build separate dylibs for device and simulator, since we already install these
into different locations.
This makes both the simulator and device builds slightly faster (since the
respective dylibs are smaller, and less data to copy around).
For watchOS apps, this saves ~430kb.
* [runtime] Strip bitcode from dylibs. Fixes #51352.
We know that dylibs will never be shipped to the App Store, so we'll never
need them to have bitcode.
So just strip the bitcode from all our dylibs, since this makes apps with
fastdev significantly smaller (and thus much faster to upload to watch
devices).
For watchOS apps this is a very significant improvement: a branch new watchOS
app without any changes goes from 35MB to 17MB.
https://bugzilla.xamarin.com/show_bug.cgi?id=51352
* [mtouch] Fix dylib compilation to not embed full bitcode.
Facts
=====
a. The output from the AOT compiler is an assembly (.s) file.
b. Clang's assembler does not support -fembed-bitcode-marker (only -fembed-
bitcode), so when we ask clang to -fembed-bitcode-marker, the assembler
receives a -fembed-bitcode argument.
c. This means that the assembled object file does not contain the
__LLVM/__bitcode and __LLVM/__cmdline sections (it does however contain an
__LLVM/__asm section).
d. The native linker will create a bitcode assembly section if none of the
object files passed to the linker contain a __LLVM/__bitcode section and
there's an __LLVM/__asm section present.
e. The end result is that when we build to a dylib, we end up (unexpectedly,
because we ask Clang to -fembed-bitcode-marker) including both armv7k and
bitcode in the dylib, thus bloating the dylib size significantly.
Solution
========
We manually add the __LLVM/__bitcode and __LLVM/__cmdline sections to the .s
file Mono's AOT compiler generated. This way the .o file will have the magic
sections, and the linker will not include bitcode (only the bitcode marker) in
the final library.
An empty watchOS extension with incremental builds is now 6MB smaller (down
to 11MB from 17MB).
2017-01-16 14:32:06 +03:00
2019-10-03 17:38:44 +03:00
.libs/$(1)/libxamarin-debug.dylib : $$( foreach arch ,$ $ ( $ ( 2) _ARCHITECTURES ) ,.libs /$ ( 1) /libxamarin -debug .$ $ ( arch ) .dylib )
Remove unnecessary bitcode from dylibs. Fixes #51352 (#1469)
This is a series of fixes to the dynamic libraries we build / create to remove
any unnecessary bloat (unused architectures, bitcode).
A brand new watchOS app with no changes goes from 35MB to 11MB with these
fixes (with incremental builds disabled, the app size is 10MB).
--------------------------------------------------------------------------------
* [runtime] Split list of architectures into simulator and device-specific lists.
* [runtime] Build separate dylibs for device and simulator.
Build separate dylibs for device and simulator, since we already install these
into different locations.
This makes both the simulator and device builds slightly faster (since the
respective dylibs are smaller, and less data to copy around).
For watchOS apps, this saves ~430kb.
* [runtime] Strip bitcode from dylibs. Fixes #51352.
We know that dylibs will never be shipped to the App Store, so we'll never
need them to have bitcode.
So just strip the bitcode from all our dylibs, since this makes apps with
fastdev significantly smaller (and thus much faster to upload to watch
devices).
For watchOS apps this is a very significant improvement: a branch new watchOS
app without any changes goes from 35MB to 17MB.
https://bugzilla.xamarin.com/show_bug.cgi?id=51352
* [mtouch] Fix dylib compilation to not embed full bitcode.
Facts
=====
a. The output from the AOT compiler is an assembly (.s) file.
b. Clang's assembler does not support -fembed-bitcode-marker (only -fembed-
bitcode), so when we ask clang to -fembed-bitcode-marker, the assembler
receives a -fembed-bitcode argument.
c. This means that the assembled object file does not contain the
__LLVM/__bitcode and __LLVM/__cmdline sections (it does however contain an
__LLVM/__asm section).
d. The native linker will create a bitcode assembly section if none of the
object files passed to the linker contain a __LLVM/__bitcode section and
there's an __LLVM/__asm section present.
e. The end result is that when we build to a dylib, we end up (unexpectedly,
because we ask Clang to -fembed-bitcode-marker) including both armv7k and
bitcode in the dylib, thus bloating the dylib size significantly.
Solution
========
We manually add the __LLVM/__bitcode and __LLVM/__cmdline sections to the .s
file Mono's AOT compiler generated. This way the .o file will have the magic
sections, and the linker will not include bitcode (only the bitcode marker) in
the final library.
An empty watchOS extension with incremental builds is now 6MB smaller (down
to 11MB from 17MB).
2017-01-16 14:32:06 +03:00
$( Q) rm -f $$ @
2019-10-03 17:38:44 +03:00
i f e q ( 1 , $$ ( w o r d s $$ ( $( 2) _ A R C H I T E C T U R E S ) ) )
$( Q) $( CP) $$ ^ $$ @
e l s e
Remove unnecessary bitcode from dylibs. Fixes #51352 (#1469)
This is a series of fixes to the dynamic libraries we build / create to remove
any unnecessary bloat (unused architectures, bitcode).
A brand new watchOS app with no changes goes from 35MB to 11MB with these
fixes (with incremental builds disabled, the app size is 10MB).
--------------------------------------------------------------------------------
* [runtime] Split list of architectures into simulator and device-specific lists.
* [runtime] Build separate dylibs for device and simulator.
Build separate dylibs for device and simulator, since we already install these
into different locations.
This makes both the simulator and device builds slightly faster (since the
respective dylibs are smaller, and less data to copy around).
For watchOS apps, this saves ~430kb.
* [runtime] Strip bitcode from dylibs. Fixes #51352.
We know that dylibs will never be shipped to the App Store, so we'll never
need them to have bitcode.
So just strip the bitcode from all our dylibs, since this makes apps with
fastdev significantly smaller (and thus much faster to upload to watch
devices).
For watchOS apps this is a very significant improvement: a branch new watchOS
app without any changes goes from 35MB to 17MB.
https://bugzilla.xamarin.com/show_bug.cgi?id=51352
* [mtouch] Fix dylib compilation to not embed full bitcode.
Facts
=====
a. The output from the AOT compiler is an assembly (.s) file.
b. Clang's assembler does not support -fembed-bitcode-marker (only -fembed-
bitcode), so when we ask clang to -fembed-bitcode-marker, the assembler
receives a -fembed-bitcode argument.
c. This means that the assembled object file does not contain the
__LLVM/__bitcode and __LLVM/__cmdline sections (it does however contain an
__LLVM/__asm section).
d. The native linker will create a bitcode assembly section if none of the
object files passed to the linker contain a __LLVM/__bitcode section and
there's an __LLVM/__asm section present.
e. The end result is that when we build to a dylib, we end up (unexpectedly,
because we ask Clang to -fembed-bitcode-marker) including both armv7k and
bitcode in the dylib, thus bloating the dylib size significantly.
Solution
========
We manually add the __LLVM/__bitcode and __LLVM/__cmdline sections to the .s
file Mono's AOT compiler generated. This way the .o file will have the magic
sections, and the linker will not include bitcode (only the bitcode marker) in
the final library.
An empty watchOS extension with incremental builds is now 6MB smaller (down
to 11MB from 17MB).
2017-01-16 14:32:06 +03:00
$$ ( call Q_2,LIPO, [ $1 ] ) $( DEVICE_BIN_PATH) /lipo $$ ^ -create -output $$ @
2019-10-03 17:38:44 +03:00
e n d i f
2017-01-24 22:24:32 +03:00
$( Q) install_name_tool -id @rpath/libxamarin-debug.dylib $$ @
$( Q) install_name_tool -change @rpath/ @rpath/libmonosgen-2.0.dylib $$ @
2016-04-21 15:19:32 +03:00
.SECONDARY : $$( foreach arch ,$ $ ( $ ( 2) _ARCHITECTURES ) ,.libs /$ ( 1) /app -main .$ $ ( arch ) .o )
e n d e f
2019-10-03 17:38:44 +03:00
$( eval $ ( call LibTemplate ,iphoneos ,IPHONEOS ) )
$( eval $ ( call LibTemplate ,iphonesimulator ,IOSSIMULATOR ) )
2016-04-21 15:19:32 +03:00
$( eval $ ( call LibTemplate ,watchos ,WATCHOS ) )
2019-10-03 17:38:44 +03:00
$( eval $ ( call LibTemplate ,watchsimulator ,WATCHSIMULATOR ) )
2016-04-21 15:19:32 +03:00
$( eval $ ( call LibTemplate ,tvos ,TVOS ) )
2019-10-03 17:38:44 +03:00
$( eval $ ( call LibTemplate ,tvsimulator ,TVSIMULATOR ) )
2016-04-21 15:19:32 +03:00
#
# LibXamarinTemplate (and LibXamarinArchTemplate) builds libxamarin.a
#
d e f i n e L i b X a m a r i n A r c h T e m p l a t e
.libs/$(1)/libxamarin$(4).$(5).a : $$( $ ( 5) _ $ ( 1) $ ( 3) _OBJECTS )
$$ ( Q) rm -f $$ @
2016-05-11 17:17:03 +03:00
$$ ( call Q_2,AR, [ $1 ] ) $( DEVICE_BIN_PATH) /ar Scru $$ @ $$ ^
$$ ( call Q_2,RANLIB,[ $1 ] ) $( DEVICE_BIN_PATH) /ranlib -no_warning_for_no_symbols -q $$ @
2016-04-21 15:19:32 +03:00
e n d e f
d e f i n e L i b X a m a r i n T e m p l a t e
$(1)$(3)_COMMON_DYLIB_FLAGS = -lmonosgen-2.0 -Wl,-install_name,libxamarin$( 4) .dylib -framework Foundation -framework CFNetwork -framework UIKit -lz
2017-04-25 18:39:58 +03:00
$(1)$(3)_COMMON_FRAMEWORK_FLAGS = -framework Mono -Wl,-install_name,@rpath/Xamarin$( 4) .framework/Xamarin$( 4) -framework Foundation -framework CFNetwork -framework UIKit -lz
2016-04-21 15:19:32 +03:00
2019-02-05 03:46:02 +03:00
x86_$(1)$(3)_OBJECTS = $$ ( patsubst %,.libs/$( 1) /%$( 4) .x86.o,$$ ( $( 2) _SOURCE_STEMS) ) $$ ( patsubst %,.libs/$( 1) /%$( 4) .x86.o,$$ ( $( 2) _I386_SOURCE_STEMS) )
x86_64_$(1)$(3)_OBJECTS = $$ ( patsubst %,.libs/$( 1) /%$( 4) .x86_64.o,$$ ( $( 2) _SOURCE_STEMS) ) $$ ( patsubst %,.libs/$( 1) /%$( 4) .x86_64.o,$$ ( $( 2) _X86_64_SOURCE_STEMS) )
armv7_$(1)$(3)_OBJECTS = $$ ( patsubst %,.libs/$( 1) /%$( 4) .armv7.o,$$ ( $( 2) _SOURCE_STEMS) )
armv7s_$(1)$(3)_OBJECTS = $$ ( patsubst %,.libs/$( 1) /%$( 4) .armv7s.o,$$ ( $( 2) _SOURCE_STEMS) )
armv7k_$(1)$(3)_OBJECTS = $$ ( patsubst %,.libs/$( 1) /%$( 4) .armv7k.o,$$ ( $( 2) _SOURCE_STEMS) )
2019-05-07 08:35:39 +03:00
arm64_$(1)$(3)_OBJECTS = $$ ( patsubst %,.libs/$( 1) /%$( 4) .arm64.o,$$ ( $( 2) _SOURCE_STEMS) ) $$ ( patsubst %,.libs/$( 1) /%$( 4) .arm64.o,$$ ( $( 2) _ARM64_SOURCE_STEMS) )
2019-01-23 23:01:43 +03:00
arm64_32_$(1)$(3)_OBJECTS = $$ ( patsubst %,.libs/$( 1) /%$( 4) .arm64_32.o,$$ ( $( 2) _SOURCE_STEMS) )
2016-04-21 15:19:32 +03:00
$$ ( f o r e a c h a r c h , $$ ( $( 2) _ A R C H I T E C T U R E S ) , $$ ( e v a l $$ ( c a l l L i b X a m a r i n A r c h T e m p l a t e , $( 1) , $( 2) , $( 3) , $( 4) , $$ ( a r c h ) ) ) )
.libs/$(1)/libxamarin$(4).a : $$( foreach arch ,$ $ ( $ ( 2) _ARCHITECTURES ) ,.libs /$ ( 1) /libxamarin $ ( 4) .$ $ ( arch ) .a )
$( Q) rm -f $$ @
$$ ( call Q_2,LIPO, [ $1 ] ) $( DEVICE_BIN_PATH) /lipo $$ ^ -create -output $$ @
.libs/$(1)/libxamarin$(4).x86.dylib : EXTRA_FLAGS =$$( $ ( 1) $ ( 3) _COMMON_DYLIB_FLAGS )
.libs/$(1)/libxamarin$(4).x86.dylib : $$( x 86_ $ ( 1) $ ( 3) _OBJECTS )
.libs/$(1)/libxamarin$(4).x86_64.dylib : EXTRA_FLAGS =$$( $ ( 1) $ ( 3) _COMMON_DYLIB_FLAGS )
.libs/$(1)/libxamarin$(4).x86_64.dylib : $$( x 86_ 64_ $ ( 1) $ ( 3) _OBJECTS )
2016-09-01 16:45:23 +03:00
.libs/$(1)/libxamarin$(4).armv7.dylib : EXTRA_FLAGS =$$( $ ( 1) $ ( 3) _COMMON_DYLIB_FLAGS ) -miphoneos -version -min =8.0
2016-04-21 15:19:32 +03:00
.libs/$(1)/libxamarin$(4).armv7.dylib : $$( armv 7_ $ ( 1) $ ( 3) _OBJECTS )
2016-09-01 16:45:23 +03:00
.libs/$(1)/libxamarin$(4).armv7s.dylib : EXTRA_FLAGS =$$( $ ( 1) $ ( 3) _COMMON_DYLIB_FLAGS ) -miphoneos -version -min =8.0
2016-04-21 15:19:32 +03:00
.libs/$(1)/libxamarin$(4).armv7s.dylib : $$( armv 7s_ $ ( 1) $ ( 3) _OBJECTS )
.libs/$(1)/libxamarin$(4).arm64.dylib : EXTRA_FLAGS =$$( $ ( 1) $ ( 3) _COMMON_DYLIB_FLAGS )
.libs/$(1)/libxamarin$(4).arm64.dylib : $$( arm 64_ $ ( 1) $ ( 3) _OBJECTS )
.libs/$(1)/libxamarin$(4).armv7k.dylib : EXTRA_FLAGS =$$( $ ( 1) $ ( 3) _COMMON_DYLIB_FLAGS )
.libs/$(1)/libxamarin$(4).armv7k.dylib : $$( armv 7k_ $ ( 1) $ ( 3) _OBJECTS )
2017-04-03 12:52:29 +03:00
2019-01-23 23:01:43 +03:00
.libs/$(1)/libxamarin$(4).arm64_32.dylib : EXTRA_FLAGS =$$( $ ( 1) $ ( 3) _COMMON_DYLIB_FLAGS )
.libs/$(1)/libxamarin$(4).arm64_32.dylib : $$( arm 64_ 32_ $ ( 1) $ ( 3) _OBJECTS )
2017-04-03 12:52:29 +03:00
.libs/$(1)/Xamarin$(4).x86.framework : EXTRA_FLAGS =$$( $ ( 1) $ ( 3) _COMMON_FRAMEWORK_FLAGS )
.libs/$(1)/Xamarin$(4).x86.framework : $$( x 86_ $ ( 1) $ ( 3) _OBJECTS )
.libs/$(1)/Xamarin$(4).x86_64.framework : EXTRA_FLAGS =$$( $ ( 1) $ ( 3) _COMMON_FRAMEWORK_FLAGS )
.libs/$(1)/Xamarin$(4).x86_64.framework : $$( x 86_ 64_ $ ( 1) $ ( 3) _OBJECTS )
.libs/$(1)/Xamarin$(4).armv7.framework : EXTRA_FLAGS =$$( $ ( 1) $ ( 3) _COMMON_FRAMEWORK_FLAGS ) -miphoneos -version -min =8.0
.libs/$(1)/Xamarin$(4).armv7.framework : $$( armv 7_ $ ( 1) $ ( 3) _OBJECTS )
.libs/$(1)/Xamarin$(4).armv7s.framework : EXTRA_FLAGS =$$( $ ( 1) $ ( 3) _COMMON_FRAMEWORK_FLAGS ) -miphoneos -version -min =8.0
.libs/$(1)/Xamarin$(4).armv7s.framework : $$( armv 7s_ $ ( 1) $ ( 3) _OBJECTS )
.libs/$(1)/Xamarin$(4).arm64.framework : EXTRA_FLAGS =$$( $ ( 1) $ ( 3) _COMMON_FRAMEWORK_FLAGS )
.libs/$(1)/Xamarin$(4).arm64.framework : $$( arm 64_ $ ( 1) $ ( 3) _OBJECTS )
.libs/$(1)/Xamarin$(4).armv7k.framework : EXTRA_FLAGS =$$( $ ( 1) $ ( 3) _COMMON_FRAMEWORK_FLAGS )
.libs/$(1)/Xamarin$(4).armv7k.framework : $$( armv 7k_ $ ( 1) $ ( 3) _OBJECTS )
2019-01-23 23:01:43 +03:00
.libs/$(1)/Xamarin$(4).arm64_32.framework : EXTRA_FLAGS =$$( $ ( 1) $ ( 3) _COMMON_FRAMEWORK_FLAGS )
.libs/$(1)/Xamarin$(4).arm64_32.framework : $$( arm 64_ 32_ $ ( 1) $ ( 3) _OBJECTS )
2016-04-21 15:19:32 +03:00
e n d e f
2019-10-03 17:38:44 +03:00
$( eval $ ( call LibXamarinTemplate ,iphoneos ,IPHONEOS ) )
$( eval $ ( call LibXamarinTemplate ,iphoneos ,IPHONEOS ,_DEBUG ,-debug ) )
$( eval $ ( call LibXamarinTemplate ,iphonesimulator ,IOSSIMULATOR ) )
$( eval $ ( call LibXamarinTemplate ,iphonesimulator ,IOSSIMULATOR ,_DEBUG ,-debug ) )
2016-04-21 15:19:32 +03:00
$( eval $ ( call LibXamarinTemplate ,watchos ,WATCHOS ) )
$( eval $ ( call LibXamarinTemplate ,watchos ,WATCHOS ,_DEBUG ,-debug ) )
2019-10-03 17:38:44 +03:00
$( eval $ ( call LibXamarinTemplate ,watchsimulator ,WATCHSIMULATOR ) )
$( eval $ ( call LibXamarinTemplate ,watchsimulator ,WATCHSIMULATOR ,_DEBUG ,-debug ) )
2016-04-21 15:19:32 +03:00
$( eval $ ( call LibXamarinTemplate ,tvos ,TVOS ) )
$( eval $ ( call LibXamarinTemplate ,tvos ,TVOS ,_DEBUG ,-debug ) )
2019-10-03 17:38:44 +03:00
$( eval $ ( call LibXamarinTemplate ,tvsimulator ,TVSIMULATOR ) )
$( eval $ ( call LibXamarinTemplate ,tvsimulator ,TVSIMULATOR ,_DEBUG ,-debug ) )
2016-04-21 15:19:32 +03:00
#
# Xamarin.Mac
#
2019-07-15 20:19:24 +03:00
MAC_ARCHITECTURES = x86_64
2016-04-21 15:19:32 +03:00
CLANG_ARCH = $( addprefix -arch ,$( MAC_ARCHITECTURES) )
2018-11-05 16:46:41 +03:00
MAC_CLANG = DEVELOPER_DIR = $( XCODE_DEVELOPER_ROOT) $( MAC_CC) -mmacosx-version-min= $( MIN_OSX_SDK_VERSION)
2016-04-21 15:19:32 +03:00
2019-07-15 20:19:24 +03:00
MAC_SHIPPED_HEADERS = xamarin/launch.h
2016-04-21 15:19:32 +03:00
2019-08-29 18:49:06 +03:00
MAC_OBJC_CFLAGS = -ObjC++ -std= c++14 -fno-exceptions -DMIN_XM_MONO_VERSION= \" $( MIN_XM_MONO_VERSION) \"
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
MAC_CFLAGS = -mmacosx-version-min= $( MIN_OSX_SDK_VERSION) -Wall -DMONOMAC -g -DMIN_XM_MONO_VERSION= \" $( MIN_XM_MONO_VERSION) \"
2016-04-21 15:19:32 +03:00
MAC_LDFLAGS = -mmacosx-version-min= $( MIN_OSX_SDK_VERSION) -framework AppKit
2019-05-12 19:06:06 +03:00
MAC_STATIC_CFLAGS = $( MAC_CFLAGS)
2016-04-21 15:19:32 +03:00
2019-07-15 20:19:24 +03:00
MAC_SOURCES = $( SHARED_SOURCES) $( SHARED_X86_64_SOURCES) launcher.m
2016-04-21 15:19:32 +03:00
ALLOWED_UNDEFINED_SYMBOLS = _xamarin_enable_debug _xammac_setup
MAC_LIBS = \
2016-05-26 00:20:33 +03:00
libextension.a \
2016-04-21 15:19:32 +03:00
libxammac.a \
libxammac-debug.a \
2018-01-22 23:16:41 +03:00
libxammac-classic.a \
libxammac-classic-debug.a\
2016-04-21 15:19:32 +03:00
libxammac.dylib \
libxammac-debug.dylib \
libxammac-system.a \
libxammac-system-debug.a \
2018-01-22 23:16:41 +03:00
libxammac-system-classic.a \
libxammac-system-classic-debug.a \
2016-04-21 15:19:32 +03:00
#
# libxammac[-debug].a: (no defines)
# This is linked into the native executable when embedding the Mono runtime.
#
# libxammac[-debug].dylib: -DDYNAMIC_MONO_RUNTIME -DDYLIB
# This is not officially supported. It's used when not wanting to use mmp for
# whatever reason (usually to make build processes easier). There is no good
# reason to keep using it, since mmp now supports creating empty 'shell' apps
# with no assemblies, which the user can fill in as they want.
#
# libxammac-system[-debug].a: -DDYNAMIC_MONO_RUNTIME
# This is used linked into the native executable when using the system Mono (i.e. not)
# embedding the Mono runtime).
#
all-local :: $( TARGETS )
d e f i n e O b j T e m p l a t e
DYNAMIC_DYLIB$(2)_OBJECTS = $$ ( foreach src,$$ ( MAC_SOURCES) ,.libs/mac/$$ ( basename $$ ( src) ) $( 3) .dylib.$( 1) .o)
STATIC_LAUNCHER$(2)_OBJECTS = $$ ( foreach src,$$ ( MAC_SOURCES) ,.libs/mac/$$ ( basename $$ ( src) ) $( 3) .static.$( 1) .o)
SYSTEM_LAUNCHER$(2)_OBJECTS = $$ ( foreach src,$$ ( MAC_SOURCES) ,.libs/mac/$$ ( basename $$ ( src) ) $( 3) .system.$( 1) .o)
.libs/mac/%$(3).dylib.$(1).o : %.m $$( SHARED_HEADERS ) | .libs /mac
2019-09-24 14:40:18 +03:00
$$ ( call Q_2,OBJC, [ mac] ) $( MAC_CLANG) -arch $( 1) $( 4) -c $$ ( MAC_OBJC_CFLAGS) $$ ( MAC_CFLAGS) -DDYNAMIC_MONO_RUNTIME -DDYLIB -o $$ @ $$ <
2016-04-21 15:19:32 +03:00
.libs/mac/%$(3).dylib.$(1).o : %.s $$( SHARED_HEADERS ) | .libs /mac
2019-09-24 14:40:18 +03:00
$$ ( call Q_2,ASM, [ mac] ) $( MAC_CLANG) -arch $( 1) $( 4) -c $$ ( MAC_CFLAGS) -DDYNAMIC_MONO_RUNTIME -DDYLIB -o $$ @ $$ <
2016-04-21 15:19:32 +03:00
.libs/mac/%$(3).static.$(1).o : %.s $$( SHARED_HEADERS ) | .libs /mac
2019-09-24 14:40:18 +03:00
$$ ( call Q_2,ASM, [ mac] ) $( MAC_CLANG) -arch $( 1) $( 4) -c $$ ( MAC_STATIC_CFLAGS) -o $$ @ $$ <
2016-04-21 15:19:32 +03:00
.libs/mac/%$(3).static.$(1).o : %.m $$( SHARED_HEADERS ) | .libs /mac
2019-09-24 14:40:18 +03:00
$$ ( call Q_2,OBJC, [ mac] ) $( MAC_CLANG) -arch $( 1) $( 4) $$ ( MAC_OBJC_CFLAGS) -c $$ ( MAC_STATIC_CFLAGS) -o $$ @ $$ <
2016-04-21 15:19:32 +03:00
.libs/mac/%$(3).system.$(1).o : %.m $$( SHARED_HEADERS ) | .libs /mac
2019-09-24 14:40:18 +03:00
$$ ( call Q_2,OBJC, [ mac] ) $( MAC_CLANG) -arch $( 1) $( 4) $$ ( MAC_OBJC_CFLAGS) -c $$ ( MAC_CFLAGS) -DDYNAMIC_MONO_RUNTIME -o $$ @ $$ <
2016-04-21 15:19:32 +03:00
.libs/mac/%$(3).system.$(1).o : %.s $$( SHARED_HEADERS ) | .libs /mac
2019-09-24 14:40:18 +03:00
$$ ( call Q_2,ASM, [ mac] ) $( MAC_CLANG) -arch $( 1) $( 4) -c $( MAC_CFLAGS) -DDYNAMIC_MONO_RUNTIME -o $$ @ $$ <
2016-04-21 15:19:32 +03:00
.libs/mac/libxammac$(3).$(1).dylib : $$( DYNAMIC_DYLIB $ ( 2) _OBJECTS )
2019-09-24 14:40:18 +03:00
$$ ( call Q_2,LD, [ mac] ) $( MAC_CLANG) -arch $( 1) -dynamiclib $$ ( MAC_LDFLAGS) -Wl,-install_name,libxammac$( 3) .dylib -o $$ @ $$ ^ $$ ( addprefix -Xlinker -U -Xlinker ,$$ ( ALLOWED_UNDEFINED_SYMBOLS) )
2016-04-21 15:19:32 +03:00
.libs/mac/libxammac$(3).$(1).a : $$( STATIC_LAUNCHER $ ( 2) _OBJECTS )
2016-05-11 17:17:03 +03:00
$$ ( call Q_2,LIB, [ mac] ) xcrun libtool -no_warning_for_no_symbols -static -o $$ @ $$ ^
2016-04-21 15:19:32 +03:00
.libs/mac/libxammac-system$(3).$(1).a : $$( SYSTEM_LAUNCHER $ ( 2) _OBJECTS )
2016-05-11 17:17:03 +03:00
$$ ( call Q_2,LIB, [ mac] ) xcrun libtool -no_warning_for_no_symbols -static -o $$ @ $$ ^
2016-04-21 15:19:32 +03:00
e n d e f
2018-06-09 04:45:24 +03:00
$( eval $ ( call ObjTemplate ,x 86_ 64,64,,,64) )
$( eval $ ( call ObjTemplate ,x 86_ 64,DEBUG 64,-debug ,-DDEBUG ,64) )
2016-04-21 15:19:32 +03:00
2016-05-26 00:20:33 +03:00
$(foreach arch,$(MAC_ARCHITECTURES),.libs/mac/extension-main.$(arch).o) : EXTRA_DEFINES =-DEXTENSION
2019-10-03 17:38:44 +03:00
.libs/mac/extension-main.%.o : | .libs /mac
2016-05-26 00:20:33 +03:00
$( Q) rm -f $@
$( call Q_2,CC, [ mac] ) $( MAC_CLANG) -c -DEXTENSION extension-main.m -arch $* -o $@
.libs/mac/libextension.%.a : .libs /mac /extension -main .%.o
$( Q) rm -f $@
$( call Q_2,AR, [ mac] ) $( DEVICE_BIN_PATH) /ar cru $@ $^
.libs/mac/libextension.a : $( foreach arch ,$ ( MAC_ARCHITECTURES ) ,.libs /mac /libextension .$ ( arch ) .a )
$( Q) rm -f $@
$( call Q_2,LIPO, [ mac] ) $( DEVICE_BIN_PATH) /lipo $^ -create -output $@
2019-07-15 20:19:24 +03:00
.libs/mac/libxammac-debug.dylib : .libs /mac /libxammac -debug .x 86_ 64.dylib
2016-04-21 15:19:32 +03:00
$( call Q_2,LIPO, [ mac] ) xcrun lipo -create $^ -o $@
2019-07-15 20:19:24 +03:00
.libs/mac/libxammac.dylib : .libs /mac /libxammac .x 86_ 64.dylib
2016-04-21 15:19:32 +03:00
$( call Q_2,LIPO, [ mac] ) xcrun lipo -create $^ -o $@
2019-07-15 20:19:24 +03:00
.libs/mac/libxammac-debug.a : .libs /mac /libxammac -debug .x 86_ 64.a
2016-04-21 15:19:32 +03:00
$( call Q_2,LIPO, [ mac] ) xcrun lipo -create $^ -o $@
2019-07-15 20:19:24 +03:00
.libs/mac/libxammac.a : .libs /mac /libxammac .x 86_ 64.a
2016-04-21 15:19:32 +03:00
$( call Q_2,LIPO, [ mac] ) xcrun lipo -create $^ -o $@
2019-07-15 20:19:24 +03:00
.libs/mac/libxammac-system-debug.a : .libs /mac /libxammac -system -debug .x 86_ 64.a
2016-04-21 15:19:32 +03:00
$( call Q_2,LIPO, [ mac] ) xcrun lipo -create $^ -o $@
2019-07-15 20:19:24 +03:00
.libs/mac/libxammac-system.a : .libs /mac /libxammac -system .x 86_ 64.a
2016-04-21 15:19:32 +03:00
$( call Q_2,LIPO, [ mac] ) xcrun lipo -create $^ -o $@
2018-01-22 23:16:41 +03:00
.libs/mac/libxammac-%.a : $( MACIOS_BINARIES_PATH ) /libxammac -%.a | .libs /mac
2018-10-29 18:09:30 +03:00
$( Q) $( CP) $< $@
2018-01-22 23:16:41 +03:00
2016-04-21 15:19:32 +03:00
RUNTIME_MAC_TARGETS_DIRS += \
.libs/mac \
$( MAC_DESTDIR) $( MAC_FRAMEWORK_CURRENT_DIR) /lib \
$( MAC_DESTDIR) $( MAC_FRAMEWORK_CURRENT_DIR) /lib/mono \
2020-05-08 14:04:32 +03:00
$( MAC_DESTDIR) $( XAMARIN_MACOS_SDK) /lib \
$( MAC_DESTDIR) $( XAMARIN_MACOS_SDK) /include/xamarin \
2016-04-21 15:19:32 +03:00
RUNTIME_MAC_TARGETS += \
$( MAC_DESTDIR) $( MAC_FRAMEWORK_CURRENT_DIR) /lib/XamMacLauncher \
$( MAC_DESTDIR) $( MAC_FRAMEWORK_CURRENT_DIR) /lib/mono/XamMacLauncher \
2020-05-08 14:04:32 +03:00
$( foreach file,$( SHIPPED_HEADERS) ,$( MAC_DESTDIR) $( XAMARIN_MACOS_SDK) /include/$( file) ) \
$( foreach file,$( MAC_SHIPPED_HEADERS) ,$( MAC_DESTDIR) $( XAMARIN_MACOS_SDK) /include/$( file) ) \
$( foreach file,$( MAC_LIBS) ,$( MAC_DESTDIR) $( XAMARIN_MACOS_SDK) /lib/$( file) ) \
2016-04-21 15:19:32 +03:00
2019-07-15 20:19:24 +03:00
# The XamMacLauncher file must exist for VSfM to be able to open XM/Classic projects (so that people can use the migration wizard)
$(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/lib/XamMacLauncher : | $( MAC_DESTDIR ) $( MAC_FRAMEWORK_CURRENT_DIR ) /lib
$( Q) touch $@
2016-04-21 15:19:32 +03:00
2020-05-08 14:04:32 +03:00
$(MAC_DESTDIR)$(XAMARIN_MACOS_SDK)/lib/% : .libs /mac /% | $( MAC_DESTDIR ) $( XAMARIN_MACOS_SDK ) /lib
2018-10-29 18:09:30 +03:00
$( Q) $( CP) $< $@
2016-04-21 15:19:32 +03:00
$(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/lib/mono/XamMacLauncher : | $( MAC_DESTDIR ) $( MAC_FRAMEWORK_CURRENT_DIR ) /lib /mono
$( Q) ln -sF ../XamMacLauncher $@
2020-05-08 14:04:32 +03:00
$(MAC_DESTDIR)$(XAMARIN_MACOS_SDK)/include/%.h : %.h | $( MAC_DESTDIR ) $( XAMARIN_MACOS_SDK ) /include /xamarin
2016-04-21 15:19:32 +03:00
$( Q) install -m 0644 $< $@
$(RUNTIME_MAC_TARGETS_DIRS) :
$( Q) mkdir -p $@
all-local :: $( RUNTIME_MAC_TARGETS )
install-local :: $( RUNTIME_MAC_TARGETS )
2020-06-15 18:47:18 +03:00
#
# .NET
#
iOS_LIBRARIES = libapp.a libextension.a
tvOS_LIBRARIES = libtvextension.a
watchOS_LIBRARIES = libextension.a libwatchextension.a
macOS_LIBRARIES = libextension.a
macOS_SHIPPED_HEADERS = $( MAC_SHIPPED_HEADERS)
d e f i n e D o t N e t L i b T e m p l a t e
DOTNET_TARGETS += \
$( DOTNET_DESTDIR) /Microsoft.$( 1) .Runtime.$( 2) /runtimes/$( 2) /native/libxamarin.dylib \
$( DOTNET_DESTDIR) /Microsoft.$( 1) .Runtime.$( 2) /runtimes/$( 2) /native/libxamarin-debug.dylib \
$( DOTNET_DESTDIR) /Microsoft.$( 1) .Runtime.$( 2) /runtimes/$( 2) /native/libxamarin.a \
$( DOTNET_DESTDIR) /Microsoft.$( 1) .Runtime.$( 2) /runtimes/$( 2) /native/libxamarin-debug.a \
$$ ( foreach lib,$$ ( $( 2) _LIBRARIES) ,$( DOTNET_DESTDIR) /Microsoft.$( 1) .Runtime.$( 2) /runtimes/$( 2) /native/$$ ( lib) ) \
$$ ( foreach header,$$ ( SHIPPED_HEADERS) ,$( DOTNET_DESTDIR) /Microsoft.$( 1) .Runtime.$( 2) /runtimes/$( 2) /native/$$ ( header) ) \
$$ ( foreach header,$$ ( $( 2) _SHIPPED_HEADERS) ,$( DOTNET_DESTDIR) /Microsoft.$( 1) .Runtime.$( 2) /runtimes/$( 2) /native/$( header) ) \
DOTNET_TARGET_DIRS += \
$( DOTNET_DESTDIR) /Microsoft.$( 1) .Runtime.$( 2) /runtimes/$( 2) /native \
$( DOTNET_DESTDIR) /Microsoft.$( 1) .Runtime.$( 2) /runtimes/$( 2) /native/xamarin \
$(DOTNET_DESTDIR)/Microsoft.$(1).Runtime.$(2)/runtimes/$(2)/native/xamarin/%.h : xamarin /%.h | $( DOTNET_DESTDIR ) /Microsoft .$( 1) .Runtime .$( 2) /runtimes /$( 2) /native /xamarin
$$ ( Q) $$ ( CP) $$ < $$ @
e n d e f
d e f i n e D o t N e t L i p o L i b T e m p l a t e
$(DOTNET_DESTDIR)/Microsoft.$(1).Runtime.$(2)/runtimes/$(2)/native/% : .libs /$( 3) /% | $( DOTNET_DESTDIR ) /Microsoft .$( 1) .Runtime .$( 2) /runtimes /$( 2) /native
$$ ( call Q_2,LIPO, [ $1 ] ) $( DEVICE_BIN_PATH) /lipo $$ < $$ ( foreach arch,$( 4) ,-extract_family $$ ( arch) ) -output $$ @
e n d e f
d e f i n e D o t N e t C o p y L i b T e m p l a t e
$(DOTNET_DESTDIR)/Microsoft.$(1).Runtime.$(2)/runtimes/$(2)/native/% : .libs /$( 3) /% | $( DOTNET_DESTDIR ) /Microsoft .$( 1) .Runtime .$( 2) /runtimes /$( 2) /native
$$ ( Q) $$ ( CP) $$ < $$ @
e n d e f
# Copy libxammac* to libxamarin* for macOS for now. Eventually we might rename libxammac to libxamarin, which would make it possible to remove this hack.
.libs/mac/libxamarin% : .libs /mac /libxammac %
$( Q) $( CP) $< $@
$( foreach platform ,$ ( DOTNET_PLATFORMS ) ,$ ( foreach rid ,$ ( DOTNET_ $ ( platform ) _RUNTIME_IDENTIFIERS ) ,$ ( eval $ ( call DotNetLibTemplate ,$ ( platform ) ,$ ( rid ) ) ) ) )
# If the RID represents fewer architectures than the library in .libs, then use the LipoTemplate, otherwise the CopyTemplate
i f d e f I N C L U D E _ I O S
$( eval $ ( call DotNetLipoLibTemplate ,iOS ,ios -x 64,iphonesimulator ,x 86_ 64) )
$( eval $ ( call DotNetLipoLibTemplate ,iOS ,ios -x 86,iphonesimulator ,i 386) )
i f d e f I N C L U D E _ D E V I C E
$( eval $ ( call DotNetLipoLibTemplate ,iOS ,ios -arm 64,iphoneos ,arm 64) )
$( eval $ ( call DotNetLipoLibTemplate ,iOS ,ios -arm ,iphoneos ,armv 7 armv 7s ) )
e n d i f
e n d i f
i f d e f I N C L U D E _ T V O S
$( eval $ ( call DotNetCopyLibTemplate ,tvOS ,tvos -x 64,tvsimulator ,x 86_ 64) )
i f d e f I N C L U D E _ D E V I C E
$( eval $ ( call DotNetCopyLibTemplate ,tvOS ,tvos -arm 64,tvos ,arm 64) )
e n d i f
e n d i f
i f d e f I N C L U D E _ W A T C H
$( eval $ ( call DotNetCopyLibTemplate ,watchOS ,watchos -x 86,watchsimulator ,i 386) )
i f d e f I N C L U D E _ D E V I C E
$( eval $ ( call DotNetLipoLibTemplate ,watchOS ,watchos -arm ,watchos ,armv 7k arm 64_ 32) )
e n d i f
e n d i f
$( eval $ ( call DotNetCopyLibTemplate ,macOS ,osx -x 64,mac ,x 86_ 64) )
d e f i n e D o t N e t F r a m e w o r k T e m p l a t e
DOTNET_TARGETS += \
$( DOTNET_DESTDIR) /Microsoft.$( 1) .Runtime.$( 2) /runtimes/$( 2) /native/Frameworks/Xamarin.framework/Xamarin \
$( DOTNET_DESTDIR) /Microsoft.$( 1) .Runtime.$( 2) /runtimes/$( 2) /native/Frameworks/Xamarin.framework/Info.plist \
$( DOTNET_DESTDIR) /Microsoft.$( 1) .Runtime.$( 2) /runtimes/$( 2) /native/Frameworks/Xamarin-debug.framework/Xamarin-debug \
$( DOTNET_DESTDIR) /Microsoft.$( 1) .Runtime.$( 2) /runtimes/$( 2) /native/Frameworks/Xamarin-debug.framework/Info.plist \
DOTNET_TARGET_DIRS += \
$( DOTNET_DESTDIR) /Microsoft.$( 1) .Runtime.$( 2) /runtimes/$( 2) /native/Frameworks/Xamarin.framework \
$( DOTNET_DESTDIR) /Microsoft.$( 1) .Runtime.$( 2) /runtimes/$( 2) /native/Frameworks/Xamarin-debug.framework
$(DOTNET_DESTDIR)/Microsoft.$(1).Runtime.$(2)/runtimes/$(2)/native/Frameworks/% : $( 5) /% | $( DOTNET_DESTDIR ) /Microsoft .$( 1) .Runtime .$( 2) /runtimes /$( 2) /native /Frameworks /Xamarin .framework $( DOTNET_DESTDIR ) /Microsoft .$( 1) .Runtime .$( 2) /runtimes /$( 2) /native /Frameworks /Xamarin -debug .framework
$$ ( Q) $$ ( CP) $$ < $$ @
e n d e f
# Frameworks have two files: Info.plist and the executable. Here we copy the Info.plist and lipo the executable.
d e f i n e D o t N e t L i p o F r a m e w o r k T e m p l a t e
$(DOTNET_DESTDIR)/Microsoft.$(1).Runtime.$(2)/runtimes/$(2)/native/Frameworks/%.plist : $( 5) /%.plist | $( DOTNET_DESTDIR ) /Microsoft .$( 1) .Runtime .$( 2) /runtimes /$( 2) /native /Frameworks /Xamarin .framework $( DOTNET_DESTDIR ) /Microsoft .$( 1) .Runtime .$( 2) /runtimes /$( 2) /native /Frameworks /Xamarin -debug .framework
$$ ( Q) $$ ( CP) $$ < $$ @
$(DOTNET_DESTDIR)/Microsoft.$(1).Runtime.$(2)/runtimes/$(2)/native/Frameworks/% : $( 5) /% | $( DOTNET_DESTDIR ) /Microsoft .$( 1) .Runtime .$( 2) /runtimes /$( 2) /native /Frameworks /Xamarin .framework $( DOTNET_DESTDIR ) /Microsoft .$( 1) .Runtime .$( 2) /runtimes /$( 2) /native /Frameworks /Xamarin -debug .framework
$$ ( call Q_2,LIPO, [ $1 ] ) $( DEVICE_BIN_PATH) /lipo $$ < $$ ( foreach arch,$( 4) ,-extract_family $$ ( arch) ) -output $$ @
e n d e f
# Just copy both the Info.plist and the executable.
d e f i n e D o t N e t C o p y F r a m e w o r k T e m p l a t e
$(DOTNET_DESTDIR)/Microsoft.$(1).Runtime.$(2)/runtimes/$(2)/native/Frameworks/% : $( 5) /% | $( DOTNET_DESTDIR ) /Microsoft .$( 1) .Runtime .$( 2) /runtimes /$( 2) /native /Frameworks /Xamarin .framework $( DOTNET_DESTDIR ) /Microsoft .$( 1) .Runtime .$( 2) /runtimes /$( 2) /native /Frameworks /Xamarin -debug .framework
$$ ( Q) $$ ( CP) $$ < $$ @
e n d e f
# macOS does not have the Xamarin[-debug].framework frameworks
$( foreach platform ,$ ( filter -out macOS ,$ ( DOTNET_PLATFORMS ) ) ,$ ( foreach rid ,$ ( DOTNET_ $ ( platform ) _RUNTIME_IDENTIFIERS ) ,$ ( eval $ ( call DotNetFrameworkTemplate ,$ ( platform ) ,$ ( rid ) ) ) ) )
# If the RID represents fewer architectures than the library in .libs, then use the LipoTemplate, otherwise the CopyTemplate
i f d e f I N C L U D E _ I O S
$( eval $ ( call DotNetLipoFrameworkTemplate ,iOS ,ios -x 64,iphonesimulator ,x 86_ 64,$ ( IOS_DESTDIR ) $ ( XAMARIN_IOSSIMULATOR_SDK ) /Frameworks ) )
$( eval $ ( call DotNetLipoFrameworkTemplate ,iOS ,ios -x 86,iphonesimulator ,i 386,$ ( IOS_DESTDIR ) $ ( XAMARIN_IOSSIMULATOR_SDK ) /Frameworks ) )
i f d e f I N C L U D E _ D E V I C E
$( eval $ ( call DotNetLipoFrameworkTemplate ,iOS ,ios -arm 64,iphoneos ,arm 64,$ ( IOS_DESTDIR ) $ ( XAMARIN_IPHONEOS_SDK ) /Frameworks ) )
$( eval $ ( call DotNetLipoFrameworkTemplate ,iOS ,ios -arm ,iphoneos ,armv 7 armv 7s ,$ ( IOS_DESTDIR ) $ ( XAMARIN_IPHONEOS_SDK ) /Frameworks ) )
e n d i f
e n d i f
i f d e f I N C L U D E _ T V O S
$( eval $ ( call DotNetCopyFrameworkTemplate ,tvOS ,tvos -x 64,tvsimulator ,x 86_ 64,$ ( IOS_DESTDIR ) $ ( XAMARIN_TVSIMULATOR_SDK ) /Frameworks ) )
i f d e f I N C L U D E _ D E V I C E
$( eval $ ( call DotNetCopyFrameworkTemplate ,tvOS ,tvos -arm 64,tvos ,arm 64,$ ( IOS_DESTDIR ) $ ( XAMARIN_TVOS_SDK ) /Frameworks ) )
e n d i f
e n d i f
i f d e f I N C L U D E _ W A T C H
$( eval $ ( call DotNetCopyFrameworkTemplate ,watchOS ,watchos -x 86,watchsimulator ,i 386,$ ( IOS_DESTDIR ) $ ( XAMARIN_WATCHSIMULATOR_SDK ) /Frameworks ) )
i f d e f I N C L U D E _ D E V I C E
$( eval $ ( call DotNetLipoFrameworkTemplate ,watchOS ,watchos -arm ,watchos ,armv 7k arm 64_ 32,$ ( IOS_DESTDIR ) $ ( XAMARIN_WATCHOS_SDK ) /Frameworks ) )
e n d i f
e n d i f
dotnet : $( DOTNET_TARGETS )
$(DOTNET_TARGET_DIRS) :
$( Q) mkdir -p $@
i f d e f E N A B L E _ D O T N E T
all-local :: $( DOTNET_TARGETS )
install-local :: $( DOTNET_TARGETS )
e n d i f
2016-04-21 15:19:32 +03:00
#
# Common
#
clean-local ::
$( Q) rm -f *.o
$( Q) rm -f *.a
$( Q) rm -Rf .libs
$( Q) rm -f xamarin/mono-runtime.h mono-runtime.m delegates.h delegates.inc Delegates.generated.cs
i n c l u d e $( TOP ) / m k / r u l e s . m k
2020-03-06 18:42:21 +03:00
.SECONDARY : delegates .h delegates .inc