xamarin-macios/tools/mtouch/Makefile

459 строки
21 KiB
Makefile
Исходник Обычный вид История

2016-04-21 15:58:45 +03:00
TOP=../..
include $(TOP)/Make.config
# without this many compiler warnings about unused functions and variables
# in system headers show up.
export CCACHE_CPP2=1
LINKER_DIR=../linker
CECIL_PATH=$(MONO_PATH)/external/cecil
MONO_CECIL_FILES = $(wildcard $(CECIL_PATH)/*.cs) $(wildcard $(CECIL_PATH)/*/*.cs) $(wildcard $(CECIL_PATH)/*/*/*.cs) $(wildcard $(CECIL_PATH)/*/*/*/*.cs) $(wildcard $(CECIL_PATH)/*/*/*/*/*.cs)
2016-04-21 15:58:45 +03:00
MONO_DIR=$(MONO_PATH)
MONOLINKER=$(LINKER_TOOLS_PATH)/linker
MONO_TUNER=$(LINKER_TOOLS_PATH)/tuner
2016-04-21 15:58:45 +03:00
LINKER_RESOURCES = \
$(LINKER_DIR)/Descriptors/mscorlib.xml
LINKER_SOURCES = \
$(MONOLINKER)/Mono.Linker/Annotations.cs \
$(MONOLINKER)/Mono.Linker/AssemblyAction.cs \
$(MONOLINKER)/Mono.Linker/AssemblyResolver.cs \
$(MONOLINKER)/Mono.Linker/I18nAssemblies.cs \
$(MONOLINKER)/Mono.Linker/IXApiVisitor.cs \
$(MONOLINKER)/Mono.Linker/LinkContext.cs \
$(MONOLINKER)/Mono.Linker/MethodAction.cs \
$(MONOLINKER)/Mono.Linker/Pipeline.cs \
$(MONOLINKER)/Mono.Linker/TypePreserve.cs \
$(MONOLINKER)/Mono.Linker/XApiReader.cs \
$(MONOLINKER)/Mono.Linker.Steps/BaseStep.cs \
$(MONOLINKER)/Mono.Linker.Steps/BlacklistStep.cs \
$(MONOLINKER)/Mono.Linker.Steps/CleanStep.cs \
$(MONOLINKER)/Mono.Linker.Steps/IStep.cs \
$(MONOLINKER)/Mono.Linker.Steps/LoadI18nAssemblies.cs \
$(MONOLINKER)/Mono.Linker.Steps/LoadReferencesStep.cs \
$(MONOLINKER)/Mono.Linker.Steps/MarkStep.cs \
$(MONOLINKER)/Mono.Linker.Steps/OutputStep.cs \
$(MONOLINKER)/Mono.Linker.Steps/ResolveFromAssemblyStep.cs \
$(MONOLINKER)/Mono.Linker.Steps/ResolveFromXApiStep.cs \
$(MONOLINKER)/Mono.Linker.Steps/ResolveFromXmlStep.cs \
$(MONOLINKER)/Mono.Linker.Steps/ResolveStep.cs \
$(MONOLINKER)/Mono.Linker.Steps/SweepStep.cs \
$(MONOLINKER)/Mono.Linker.Steps/TypeMapStep.cs \
$(MONO_TUNER)/Mono.Tuner/ApplyPreserveAttributeBase.cs \
$(MONO_TUNER)/Mono.Tuner/CecilRocks.cs \
$(MONO_TUNER)/Mono.Tuner/CustomizeActions.cs \
$(MONO_TUNER)/Mono.Tuner/Dispatcher.cs \
$(MONO_TUNER)/Mono.Tuner/Extensions.cs \
$(MONO_TUNER)/Mono.Tuner/FixModuleFlags.cs \
$(MONO_TUNER)/Mono.Tuner/PreserveSoapHttpClients.cs \
$(MONO_TUNER)/Mono.Tuner/Profile.cs \
$(MONO_TUNER)/Mono.Tuner/RemoveAttributesBase.cs \
$(MONO_TUNER)/Mono.Tuner/RemoveResources.cs \
$(MONO_TUNER)/Mono.Tuner/RemoveSecurity.cs \
$(LINKER_DIR)/MonoTouch.Tuner/Extensions.cs \
[linker] Add an well known candidate inliner substep along with tests (#1513) TL&DR: This is *how* it should be done and tested, it's not complete (single, simple case) nor the most interesting case ;-) The trick is to make sure each case is covered by tests so a mono _bump_ won't give us a BCL that does not conform to what the linker expect. What's the impact ? 1. There is the expected reduction of metadata in mscorlib. Since both methods don't call other API there's no indirect effect (removal). --- before 2017-01-15 11:12:44.000000000 -0500 +++ after 2017-01-15 11:12:56.000000000 -0500 @@ -13166,9 +13166,6 @@ System.Void System.Security.SecurityException::.ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext) System.Void System.Security.SecurityException::.ctor(System.String) System.Void System.Security.SecurityException::GetObjectData(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext) -System.Boolean System.Security.SecurityManager::CheckElevatedPermissions() -System.Security.SecurityManager -System.Void System.Security.SecurityManager::EnsureElevatedPermissions() System.Security.SecurityRulesAttribute System.Security.SecurityRuleSet System.Security.SecurityRulesAttribute::m_ruleSet System.Void System.Security.SecurityRulesAttribute::.ctor(System.Security.SecurityRuleSet) 2. There is no visible size change (even with #1) in mscorlib.dll due to padding (compiler /filealign) mscorlib.dll 793,600 793,600 0 0.00 % 3. there's a *very* small reduction of mscorlib.*.aotdata size mscorlib.armv7.aotdata 717,264 717,216 -48 -0.01 % mscorlib.arm64.aotdata 712,840 712,704 -136 -0.02 % AOT data *.aotdata 6,460,064 6,459,880 -184 0.00 % 4. there's no change in executable size - normal as the AOT compiler has _likely_ already doing the same optimization (before this commit) Executable 29,270,272 29,270,272 0 0.00 % Full comparison: https://gist.github.com/spouliot/0464c8fa3a92b6486dfd90595d9eb718
2017-01-18 05:49:44 +03:00
$(LINKER_DIR)/MonoTouch.Tuner/InlinerSubStep.cs \
2016-04-21 15:58:45 +03:00
$(LINKER_DIR)/MonoTouch.Tuner/ListExportedSymbols.cs \
$(LINKER_DIR)/MonoTouch.Tuner/MetadataReducerSubStep.cs \
$(LINKER_DIR)/MonoTouch.Tuner/MonoTouchMarkStep.cs \
$(LINKER_DIR)/MonoTouch.Tuner/MonoTouchProfile.cs \
$(LINKER_DIR)/MonoTouch.Tuner/MonoTouchSweepStep.cs \
$(LINKER_DIR)/MonoTouch.Tuner/MonoTouchTypeMap.cs \
$(LINKER_DIR)/MonoTouch.Tuner/OptimizeGeneratedCodeSubStep.cs \
$(LINKER_DIR)/MonoTouch.Tuner/PreserveCode.cs \
$(LINKER_DIR)/MonoTouch.Tuner/ProcessExportedFields.cs \
$(LINKER_DIR)/MonoTouch.Tuner/RemoveAttributes.cs \
$(LINKER_DIR)/MonoTouch.Tuner/RemoveCode.cs \
$(LINKER_DIR)/MonoTouch.Tuner/SealerSubStep.cs \
$(TOP)/tools/linker/ApplyPreserveAttribute.cs \
$(TOP)/tools/linker/BaseProfile.cs \
$(TOP)/tools/linker/CoreHttpMessageHandler.cs \
$(TOP)/tools/linker/CoreMarkStep.cs \
$(TOP)/tools/linker/CoreOptimizeGeneratedCode.cs \
$(TOP)/tools/linker/CorePreserveCode.cs \
$(TOP)/tools/linker/CoreRemoveAttributes.cs \
$(TOP)/tools/linker/CoreRemoveSecurity.cs \
[mtouch][linker] Provide a more specific error code when OptimizeGeneratedCodeSubStep fails (#903) The MT2001 error is a general, something went bad, in the linker code base. The stack trace is often enough to track down issues but in some cases it would be easier to ask customers for a specific assembly (rather than their complete project) to investigate an issue. Example: error MT2103: Binding Optimizer failed processing `System.Void GoogleConversionTracking.Unified.GoogleConversionPing::.ctor()`. --- inner exception System.NullReferenceException: Object reference not set to an instance of an object at MonoTouch.Tuner.OptimizeGeneratedCodeSubStep.ProcessIsDirectBinding (Mono.Cecil.MethodDefinition caller, Mono.Cecil.Cil.Instruction ins) [0x00026] in /Users/poupou/git/xamarin/xamarin-macios/tools/linker/MonoTouch.Tuner/OptimizeGeneratedCodeSubStep.cs:264 at MonoTouch.Tuner.OptimizeGeneratedCodeSubStep.ProcessCalls (Mono.Cecil.MethodDefinition caller, Int32 i) [0x00337] in /Users/poupou/git/xamarin/xamarin-macios/tools/linker/MonoTouch.Tuner/OptimizeGeneratedCodeSubStep.cs:197 at MonoTouch.Tuner.OptimizeGeneratedCodeSubStep.Process (Mono.Cecil.MethodDefinition method) [0x0007b] in /Users/poupou/git/xamarin/xamarin-macios/tools/linker/MonoTouch.Tuner/OptimizeGeneratedCodeSubStep.cs:81 at Xamarin.Linker.StateSubStep.ProcessMethod (Mono.Cecil.MethodDefinition method) [0x00004] in /Users/poupou/git/xamarin/xamarin-macios/tools/linker/CoreOptimizeGeneratedCode.cs:48 --- at Xamarin.Linker.StateSubStep.ProcessMethod (Mono.Cecil.MethodDefinition method) [0x00014] in /Users/poupou/git/xamarin/xamarin-macios/tools/linker/CoreOptimizeGeneratedCode.cs:50 at Mono.Tuner.SubStepDispatcher.DispatchMethod (Mono.Cecil.MethodDefinition method) [0x0001d] in /Users/poupou/git/xamarin/xamarin-macios/external/mono/mcs/tools/tuner/Mono.Tuner/Dispatcher.cs:215 at Mono.Tuner.SubStepDispatcher.BrowseMethods (ICollection methods) [0x0001c] in /Users/poupou/git/xamarin/xamarin-macios/external/mono/mcs/tools/tuner/Mono.Tuner/Dispatcher.cs:167 at Mono.Tuner.SubStepDispatcher.BrowseTypes (ICollection types) [0x0006b] in /Users/poupou/git/xamarin/xamarin-macios/external/mono/mcs/tools/tuner/Mono.Tuner/Dispatcher.cs:145 at Mono.Tuner.SubStepDispatcher.BrowseAssemblies (IEnumerable`1 assemblies) [0x00050] in /Users/poupou/git/xamarin/xamarin-macios/external/mono/mcs/tools/tuner/Mono.Tuner/Dispatcher.cs:123 at Mono.Tuner.SubStepDispatcher.Process (Mono.Linker.LinkContext context) [0x0000f] in /Users/poupou/git/xamarin/xamarin-macios/external/mono/mcs/tools/tuner/Mono.Tuner/Dispatcher.cs:104 at Mono.Linker.Pipeline.Process (Mono.Linker.LinkContext context) [0x00027] in /Users/poupou/git/xamarin/xamarin-macios/external/mono/mcs/tools/linker/Mono.Linker/Pipeline.cs:118 at MonoTouch.Tuner.Linker.Process (MonoTouch.Tuner.LinkerOptions options, MonoTouch.Tuner.MonoTouchLinkContext& context, System.Collections.Generic.List`1& assemblies) [0x000ac] in /Users/poupou/git/xamarin/xamarin-macios/tools/mtouch/Tuning.cs:79 Right now the MT2001 would only include the inner exception, which does not include any clue to which assembly caused the exception. Note: The same pattern to be applied to other BaseSubStep subclasses in separate commits. Related to (but not the fix for) https://bugzilla.xamarin.com/show_bug.cgi?id=44701
2016-09-28 18:46:14 +03:00
$(TOP)/tools/linker/ExceptionalSubStep.cs \
2016-04-21 15:58:45 +03:00
$(TOP)/tools/linker/MarkNSObjects.cs \
$(TOP)/tools/linker/MobileExtensions.cs \
$(TOP)/tools/linker/MobileMarkStep.cs \
$(TOP)/tools/linker/MobileProfile.cs \
$(TOP)/tools/linker/MobileRemoveAttributes.cs \
$(TOP)/tools/linker/MobileResolveMainAssemblyStep.cs \
$(TOP)/tools/linker/MobileSweepStep.cs \
$(TOP)/tools/linker/ObjCExtensions.cs \
$(TOP)/tools/linker/RemoveUserResourcesSubStep.cs \
2016-04-21 15:58:45 +03:00
COMMON_SOURCES = \
$(TOP)/src/build/ios/Constants.cs \
error.cs \
$(TOP)/src/ObjCRuntime/ErrorHelper.cs \
$(TOP)/src/ObjCRuntime/ExceptionMode.cs \
2016-04-21 15:58:45 +03:00
$(MONO_DIR)/mcs/class/Mono.Options/Mono.Options/Options.cs
MTOUCH_SOURCES = \
$(COMMON_SOURCES) \
$(LINKER_SOURCES) \
$(TOP)/src/ObjCRuntime/ArgumentSemantic.cs \
$(TOP)/src/ObjCRuntime/LinkWithAttribute.cs \
$(TOP)/src/ObjCRuntime/NativeAttribute.cs \
$(TOP)/src/ObjCRuntime/PlatformAvailability2.cs \
$(TOP)/src/ObjCRuntime/ObjectWrapper.cs \
Application.cs \
Assembly.cs \
$(TOP)/tools/common/cache.cs \
$(TOP)/tools/common/Driver.cs \
$(TOP)/tools/common/Frameworks.cs \
$(TOP)/tools/common/MachO.cs \
mtouch.cs \
$(TOP)/tools/common/PInvokeWrapperGenerator.cs \
2016-04-21 15:58:45 +03:00
$(TOP)/tools/common/TargetFramework.cs \
$(TOP)/tools/common/BuildTasks.cs \
2016-04-21 15:58:45 +03:00
$(TOP)/tools/common/StaticRegistrar.cs \
$(TOP)/src/ObjCRuntime/Registrar.core.cs \
$(TOP)/src/ObjCRuntime/Registrar.cs \
$(TOP)/src/ObjCRuntime/RuntimeOptions.cs \
Tuning.cs \
Stripper.cs \
AssemblyResolver.cs \
Target.cs \
SdkVersions.cs \
BitcodeConverter.cs \
BuildTasks.mtouch.cs \
2016-04-21 15:58:45 +03:00
$(TOP)/tools/common/Application.cs \
$(TOP)/tools/common/Assembly.cs \
$(TOP)/tools/common/DerivedLinkContext.cs \
2016-04-21 15:58:45 +03:00
$(TOP)/tools/common/Target.cs \
$(TOP)/tools/common/CompilerFlags.cs \
$(TOP)/src/Foundation/ExportAttribute.cs \
$(TOP)/src/Foundation/ConnectAttribute.cs \
$(XAMARIN_MACDEV_PATH)/Xamarin.MacDev/PListObject.cs \
2016-04-21 15:58:45 +03:00
CECIL_CONFIG=net_4_0_Release
MONO_CECIL_DLL=$(CECIL_PATH)/bin/$(CECIL_CONFIG)/Mono.Cecil.dll
MONO_CECIL_MDB_DLL=$(CECIL_PATH)/bin/$(CECIL_CONFIG)/Mono.Cecil.Mdb.dll
MONO_CECIL_FILES=$(wildcard $(CECIL_PATH)/*.cs) $(wildcard $(CECIL_PATH)/*/*.cs) $(wildcard $(CECIL_PATH)/*/*/*.cs) $(wildcard $(CECIL_PATH)/*/*/*/*.cs) $(wildcard $(CECIL_PATH)/*/*/*/*/*.cs)
2016-04-21 15:58:45 +03:00
$(MONO_CECIL_DLL): $(CECIL_PATH)/Mono.Cecil.csproj $(MONO_CECIL_FILES)
$(Q_XBUILD) cd $(CECIL_PATH) && $(SYSTEM_XBUILD) /p:Configuration=$(CECIL_CONFIG) Mono.Cecil.csproj $(XBUILD_VERBOSITY)
2016-04-21 15:58:45 +03:00
$(MONO_CECIL_MDB_DLL): $(MONO_CECIL_DLL) $(CECIL_PATH)/symbols/mdb/Mono.Cecil.Mdb.csproj $(MONO_CECIL_FILES)
$(Q_XBUILD) cd $(CECIL_PATH) && $(SYSTEM_XBUILD) /p:Configuration=$(CECIL_CONFIG) symbols/mdb/Mono.Cecil.Mdb.csproj $(XBUILD_VERBOSITY)
2016-04-21 15:58:45 +03:00
SIMLAUNCHERS = simlauncher32-sgen simlauncher64-sgen
2016-04-21 15:58:45 +03:00
monotouch-fixes.i386.dylib: monotouch-fixes.c Makefile
$(SIMULATOR_CCOMPILE) -DDEBUG -Wl,-headerpad_max_install_names -g -dynamiclib -gdwarf-2 -I$(TOP)/runtime/.libs -L$(TOP)/runtime/.libs $(SIMULATOR86_CFLAGS) monotouch-fixes.c -o $@ -Wall
monotouch-fixes.x86_64.dylib: monotouch-fixes.c Makefile
$(SIMULATOR_CCOMPILE) -DDEBUG -Wl,-headerpad_max_install_names -g -dynamiclib -gdwarf-2 -I$(TOP)/runtime/.libs -L$(TOP)/runtime/.libs $(SIMULATOR64_CFLAGS) monotouch-fixes.c -o $@ -Wall
monotouch-fixes.dylib: monotouch-fixes.i386.dylib monotouch-fixes.x86_64.dylib
$(Q_LIPO) lipo -create -output $@ $^
UNREFERENCED_SYMBOLS = \
_xamarin_dyn_objc_msgSend \
_xamarin_dyn_objc_msgSendSuper \
_xamarin_dyn_objc_msgSend_stret \
_xamarin_dyn_objc_msgSendSuper_stret \
2016-04-21 15:58:45 +03:00
_xamarin_init_nsthread \
_xamarin_get_block_descriptor \
_xamarin_get_locale_country_code \
_xamarin_log \
_xamarin_start_wwan \
_xamarin_timezone_get_data \
_xamarin_timezone_get_names \
_xamarin_IntPtr_objc_msgSend_IntPtr \
_xamarin_IntPtr_objc_msgSendSuper_IntPtr \
_xamarin_release_managed_ref \
_xamarin_create_managed_ref \
_CloseZStream \
_CreateZStream \
_Flush \
_ReadZStream \
_WriteZStream
# The frameworks order is important as some symbols can be duplicated
# e.g. NSURLResponse is both in CFNetwork and Foundation in iOS8 but linking to
# CFNetwork will result in binaries that won't work with earlier iOS versions
SIMLAUNCHER_FRAMEWORKS = \
-framework CoreFoundation \
-framework CoreGraphics \
-framework Foundation \
-framework AVFoundation \
-framework Accelerate \
-framework AddressBook \
-framework AddressBookUI \
-framework AudioToolbox \
-framework CFNetwork \
-framework CoreAudio \
-framework CoreData \
-framework CoreLocation \
-framework CoreText \
-framework ExternalAccessory \
-framework GameKit \
-framework IOKit \
-framework MapKit \
-framework MediaPlayer \
-framework MessageUI \
-framework MobileCoreServices \
-framework OpenAL \
-framework OpenGLES \
-framework StoreKit \
-framework SystemConfiguration \
-framework UIKit \
\
-weak_framework AssetsLibrary \
-weak_framework CoreMedia \
-weak_framework CoreMidi \
-weak_framework CoreMotion \
-weak_framework CoreTelephony \
-weak_framework CoreVideo \
-weak_framework EventKit \
-weak_framework EventKitUI \
-weak_framework ImageIO \
-weak_framework Security \
-weak_framework QuickLook \
-weak_framework iAd \
-weak_framework Accounts \
-weak_framework GLKit \
-weak_framework NewsstandKit \
-weak_framework CoreImage \
-weak_framework CoreBluetooth \
-weak_framework Twitter \
-weak_framework PassKit \
-weak_framework Social \
-weak_framework AdSupport \
-weak_framework JavaScriptCore \
-weak_framework MultipeerConnectivity \
-weak_framework SafariServices \
-weak_framework SpriteKit \
\
-weak_framework HomeKit \
-weak_framework HealthKit \
-weak_framework LocalAuthentication \
-weak_framework NotificationCenter \
-weak_framework PushKit \
-weak_framework Photos \
-weak_framework PhotosUI \
-weak_framework SceneKit \
-weak_framework CloudKit \
-weak_framework AVKit \
-weak_framework WebKit \
-weak_framework NetworkExtension \
-weak_framework Metal \
-weak_framework CoreAudioKit \
\
-weak_framework WatchKit \
\
-weak_framework ReplayKit \
-weak_framework Contacts \
-weak_framework ContactsUI \
-weak_framework CoreSpotlight \
-weak_framework WatchConnectivity \
-weak_framework ModelIO \
-weak_framework GameplayKit \
\
-weak_framework HealthKitUI \
\
-weak_framework CallKit \
-weak_framework Messages \
-weak_framework Speech \
-weak_framework VideoSubscriberAccount \
-weak_framework UserNotifications \
-weak_framework UserNotificationsUI \
-weak_framework Intents \
-weak_framework IntentsUI
2016-04-21 15:58:45 +03:00
# note: there _was_ no CoreAudioKit.framework or Metal.framework for the simulator (before recent iOS9 betas)
# note 2: there's no GameKit, in iOS 9 (beta 3 at least), you're supposed to reference GameCenter instead (looks fixed in beta 4)
# note 3: there's no MetalKit or MetalPerformanceShaders in iOS 9 beta 4 - but other frameworks were added
# note 4: GameCenter was removed in Xcode 7 beta 5, and GameKit is back.
# keep the above list of weak_framework in sync with mtouch.cs
# except it is no a mistake that GameController and MediaAccessibility (#13636) are not built into simlauncher
define SimlauncherTemplate
simlauncher$(5)$(1): simlauncher.m $(TOP)/runtime/.libs/ios/libxamarin.a $(BUILD_DESTDIR)/simulator$(4)/lib/libmono$(3)-2.0.a Makefile Xamarin.iOS.registrar.ios.a
$(QT_CC) $(SIMULATOR_CC) -DDEBUG -DSIMLAUNCHER $(2) -gdwarf-2 \
-L$(TOP)/runtime/.libs/ios \
-L$(BUILD_DESTDIR)/simulator$(4)/lib/ \
-I$(TOP)/runtime \
-I$(BUILD_DESTDIR)/simulator$(4)/include/mono-2.0 \
-I$(TOP)/builds/simulator$(4)/eglib/src \
-I$(MONO_PATH)/eglib/src \
$(BUILD_DESTDIR)/simulator$(4)/lib/libmono$(3)-2.0.a \
$(foreach u,$(UNREFERENCED_SYMBOLS),-u $u) \
$(TOP)/runtime/.libs/ios/libapp.a \
-Wl,-w \
-lz -liconv $(TOP)/runtime/.libs/ios/libxamarin-debug.a simlauncher.m $(SIMLAUNCHER_FRAMEWORKS) $(SIMULATOR$(4)_OBJC_CFLAGS) -o $$@
endef
$(eval $(call SimlauncherTemplate,-sgen,$(BUILD_DESTDIR)/simulator86/lib/libmono-profiler-log.a -u _mono_profiler_startup -DXAMCORE_2_0 Xamarin.iOS.registrar.ios.a,sgen,86,32))
$(eval $(call SimlauncherTemplate,-sgen,$(BUILD_DESTDIR)/simulator64/lib/libmono-profiler-log.a -u _mono_profiler_startup -DXAMCORE_2_0 Xamarin.iOS.registrar.ios.a,sgen,64,64))
IOS_DEFINES = -d:MONOTOUCH -d:MTOUCH $(APPLETLS_DEFINES)
ifdef ENABLE_BITCODE_ON_IOS
MTOUCH_DEFINES= -define:ENABLE_BITCODE_ON_IOS
endif
MTOUCH_COMPILE_DEPS = $(MTOUCH_SOURCES) $(MONO_CECIL_DLL) $(MONO_CECIL_MDB_DLL) Makefile $(LINKER_RESOURCES)
2017-04-11 17:59:18 +03:00
MTOUCH_COMPILE_ARGS = -unsafe $(IOS_DEFINES) -r:$(MONO_CECIL_DLL) -r:$(MONO_CECIL_MDB_DLL) -r:System.Xml.Linq.dll $(MTOUCH_SOURCES) -nowarn:0436 $(LINKER_RESOURCES:%=-resource:%) $(MTOUCH_DEFINES) -debug:portable
2016-04-21 15:58:45 +03:00
# bin/Debug/mtouch.exe is used from mtouch.csproj when debugging
bin/Debug/mtouch.exe: $(MTOUCH_COMPILE_DEPS)
$(Q) mkdir -p bin/Debug
2017-04-11 17:59:18 +03:00
$(Q_CSC) $(SYSTEM_CSC) $(MTOUCH_COMPILE_ARGS) -out:$@ -d:DEV
2016-04-21 15:58:45 +03:00
SdkVersions.cs: SdkVersions.cs.in Makefile $(TOP)/Make.config
$(Q_GEN) sed \
-e 's/@IOS_SDK_VERSION@/$(IOS_SDK_VERSION)/g' -e 's/@WATCHOS_SDK_VERSION@/$(WATCH_SDK_VERSION)/' -e 's/@TVOS_SDK_VERSION@/$(TVOS_SDK_VERSION)/' -e 's/@OSX_SDK_VERSION@/$(OSX_SDK_VERSION)/' \
-e 's/@MIN_IOS_SDK_VERSION@/$(MIN_IOS_SDK_VERSION)/g' -e 's/@MIN_WATCHOS_SDK_VERSION@/$(MIN_WATCHOS_SDK_VERSION)/' -e 's/@MIN_TVOS_SDK_VERSION@/$(MIN_TVOS_SDK_VERSION)/' -e 's/@MIN_OSX_SDK_VERSION@/$(MIN_OSX_SDK_VERSION)/' \
-e 's/@XCODE_VERSION@/$(XCODE_VERSION)/g' \
$< > $@
# bin/Makefile/mtouch.exe is what we build from the makefile (and end up releasing)
bin/Makefile/mtouch.exe: $(MTOUCH_COMPILE_DEPS)
2016-04-21 15:58:45 +03:00
$(Q) mkdir -p $(dir $@)
2017-04-11 17:59:18 +03:00
$(Q_CSC) $(SYSTEM_CSC) $(MTOUCH_COMPILE_ARGS) -out:$@
2016-04-21 15:58:45 +03:00
LOCAL_MTOUCH = \
bin/Makefile/mtouch.exe \
bin/Makefile/Mono.Cecil.dll \
bin/Makefile/Mono.Cecil.Mdb.dll \
bin/Makefile/Mono.Cecil.dll: $(MONO_CECIL_DLL) | bin/Makefile
$(Q) cp $<* $(dir $@)
bin/Makefile/Mono.Cecil.Mdb.dll: $(MONO_CECIL_MDB_DLL) | bin/Makefile
$(Q) cp $<* $(dir $@)
%.registrar.ios.i386.m %.registrar.ios.i386.h: $(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/lib/32bits/%.dll $(LOCAL_MTOUCH)
$(Q_GEN) $(SYSTEM_MONO) --debug bin/Makefile/mtouch.exe --xamarin-framework-directory=$(IOS_DESTDIR)/$(MONOTOUCH_PREFIX) $(MTOUCH_VERBOSITY) --runregistrar:$(abspath $(basename $@).m) --sdkroot $(XCODE_DEVELOPER_ROOT) --sdk $(IOS_SDK_VERSION) $< --registrar:static --target-framework Xamarin.iOS,v1.0 --abi i386
$(Q) touch $(basename $@).m $(basename $@).h
%.registrar.ios.x86_64.m %.registrar.ios.x86_64.h: $(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/lib/64bits/%.dll $(LOCAL_MTOUCH)
$(Q_GEN) $(SYSTEM_MONO) --debug bin/Makefile/mtouch.exe --xamarin-framework-directory=$(IOS_DESTDIR)/$(MONOTOUCH_PREFIX) $(MTOUCH_VERBOSITY) --runregistrar:$(abspath $(basename $@).m) --sdkroot $(XCODE_DEVELOPER_ROOT) --sdk $(IOS_SDK_VERSION) $< --registrar:static --target-framework Xamarin.iOS,v1.0 --abi x86_64
$(Q) touch $(basename $@).m $(basename $@).h
2016-04-21 15:58:45 +03:00
%.registrar.watchos.m %.registrar.watchos.h: $(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/lib/mono/Xamarin.WatchOS/%.dll $(LOCAL_MTOUCH)
$(Q_GEN) $(SYSTEM_MONO) --debug bin/Makefile/mtouch.exe --xamarin-framework-directory=$(IOS_DESTDIR)/$(MONOTOUCH_PREFIX) $(MTOUCH_VERBOSITY) --runregistrar:$(abspath $(basename $@).m) --sdkroot $(XCODE_DEVELOPER_ROOT) --sdk $(WATCH_SDK_VERSION) $< --registrar:static --target-framework Xamarin.WatchOS,1.0 --abi i386
$(Q) touch $(basename $@).m $(basename $@).h
2016-04-21 15:58:45 +03:00
%.registrar.tvos.m %.registrar.tvos.h: $(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/lib/mono/Xamarin.TVOS/%.dll $(LOCAL_MTOUCH)
$(Q_GEN) $(SYSTEM_MONO) --debug bin/Makefile/mtouch.exe --xamarin-framework-directory=$(IOS_DESTDIR)/$(MONOTOUCH_PREFIX) $(MTOUCH_VERBOSITY) --runregistrar:$(abspath $(basename $@).m) --sdkroot $(XCODE_DEVELOPER_ROOT) --sdk $(TVOS_SDK_VERSION) $< --registrar:static --target-framework Xamarin.TVOS,1.0 --abi x86_64
$(Q) touch $(basename $@).m $(basename $@).h
2016-04-21 15:58:45 +03:00
%.registrar.ios.a: %.registrar.ios.i386.a %.registrar.ios.x86_64.a
$(Q_LIPO) $(DEVICE_BIN_PATH)/lipo -create -output $@ $^
%.registrar.ios.i386.a: %.registrar.ios.i386.m %.registrar.ios.i386.h
$(Q_CC) $(IOS_CC) -DDEBUG -g -gdwarf-2 $(SIMULATOR86_CFLAGS) -x objective-c++ -o $@ -c $< -Wall -I$(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/SDKs/MonoTouch.iphonesimulator.sdk/usr/include
2016-04-21 15:58:45 +03:00
%.registrar.ios.x86_64.a: %.registrar.ios.x86_64.m %.registrar.ios.x86_64.h
$(Q_CC) $(IOS_CC) -DDEBUG -g -gdwarf-2 $(SIMULATOR64_CFLAGS) -x objective-c++ -o $@ -c $< -Wall -I$(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/SDKs/MonoTouch.iphonesimulator.sdk/usr/include
2016-04-21 15:58:45 +03:00
%.registrar.watchos.a: %.registrar.watchos.m %.registrar.watchos.h
$(Q_CC) $(IOS_CC) -DDEBUG -g -gdwarf-2 $(SIMULATORWATCH_CFLAGS) -x objective-c++ -o $@ -c $< -Wall -I$(IOS_DESTDIR)$(XAMARIN_WATCHSIMULATOR_SDK)/usr/include
2016-04-21 15:58:45 +03:00
%.registrar.tvos.a: %.registrar.tvos.m %.registrar.tvos.h
$(Q_CC) $(IOS_CC) -DDEBUG -g -gdwarf-2 $(SIMULATORTV_CFLAGS) -x objective-c++ -o $@ -c $< -Wall -I$(IOS_DESTDIR)$(XAMARIN_TVSIMULATOR_SDK)/usr/include
2016-04-21 15:58:45 +03:00
TARGETS = \
$(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/bin/mtouch \
$(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/lib/mtouch/mtouch.exe \
$(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/lib/mtouch/Mono.Cecil.dll \
$(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/lib/mtouch/Mono.Cecil.Mdb.dll \
2016-04-21 15:58:45 +03:00
$(foreach launcher,$(SIMLAUNCHERS),$(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/bin/$(launcher)) \
$(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/lib/monotouch-fixes.dylib \
$(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/SDKs/MonoTouch.iphonesimulator.sdk/usr/lib/Xamarin.iOS.registrar.a \
ifdef INCLUDE_WATCH
TARGETS += $(IOS_DESTDIR)$(XAMARIN_WATCHSIMULATOR_SDK)/usr/lib/Xamarin.WatchOS.registrar.a
endif
ifdef INCLUDE_TVOS
TARGETS += \
$(IOS_DESTDIR)$(XAMARIN_TVSIMULATOR_SDK)/usr/lib/Xamarin.TVOS.registrar.a \
2016-04-21 15:58:45 +03:00
endif
TARGET_DIRS = \
bin/Makefile \
2016-04-21 15:58:45 +03:00
$(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/bin \
$(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/lib \
$(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/lib/mtouch \
2016-04-21 15:58:45 +03:00
$(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/etc/mono/assemblies/System \
$(IOS_DESTDIR)$(MONOTOUCH_SIMULATOR_SDK)/usr/lib \
$(IOS_DESTDIR)$(XAMARIN_WATCHSIMULATOR_SDK)/usr/lib \
$(IOS_DESTDIR)$(XAMARIN_TVSIMULATOR_SDK)/usr/lib \
$(TARGET_DIRS):
$(Q) mkdir -p $@
$(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/lib/mtouch/mtouch.exe: bin/Makefile/mtouch.exe | $(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/lib/mtouch
$(Q) cp $< $(dir $@)
$(Q) cp $(<:.exe=.pdb) $(dir $@)
$(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/lib/mtouch/Mono.Cecil.dll: $(MONO_CECIL_DLL) | $(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/lib/mtouch
$(Q) cp $< $(dir $@)
$(Q) cp $(<:.exe=.pdb) $(dir $@)
$(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/lib/mtouch/Mono.Cecil.Mdb.dll: $(MONO_CECIL_MDB_DLL) | $(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/lib/mtouch
$(Q) cp $< $(dir $@)
$(Q) cp $(<:.exe=.pdb) $(dir $@)
$(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/bin/mtouch: mtouch.in | $(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/bin
$(Q_GEN) sed 's!@MONOTOUCH_PREFIX@!$(abspath $(IOS_TARGETDIR)$(MONOTOUCH_PREFIX))!g' $< > $@
$(Q) chmod +x $@
2016-04-21 15:58:45 +03:00
$(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/bin/%: % | $(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/bin
$(Q) cp $< $@
$(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/lib/%: % | $(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/lib
$(Q) cp $< $@
$(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/lib/monotouch-fixes.dylib: monotouch-fixes.dylib | $(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/lib
$(Q) cp $< $@
$(Q) install_name_tool -id $(IOS_TARGETDIR)$(MONOTOUCH_PREFIX)/lib/monotouch-fixes.dylib $@
$(IOS_DESTDIR)$(MONOTOUCH_SIMULATOR_SDK)/usr/lib/%.registrar.a: %.registrar.ios.a | $(IOS_DESTDIR)$(MONOTOUCH_SIMULATOR_SDK)/usr/lib
$(Q) cp $< $@
$(IOS_DESTDIR)$(XAMARIN_WATCHSIMULATOR_SDK)/usr/lib/%.registrar.a: %.registrar.watchos.a | $(IOS_DESTDIR)$(XAMARIN_WATCHSIMULATOR_SDK)/usr/lib
$(Q) cp $< $@
$(IOS_DESTDIR)$(XAMARIN_TVSIMULATOR_SDK)/usr/lib/%.registrar.a: %.registrar.tvos.a | $(IOS_DESTDIR)$(XAMARIN_TVSIMULATOR_SDK)/usr/lib
$(Q) cp $< $@
ifdef INCLUDE_IOS
install-local:: $(TARGETS)
all-local:: $(TARGETS)
endif
mtouch: \
$(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/bin/mtouch \
$(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/lib/mtouch/mtouch.exe \
$(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/lib/mtouch/Mono.Cecil.dll \
$(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/lib/mtouch/Mono.Cecil.Mdb.dll
2016-04-21 15:58:45 +03:00
clean-local::
rm -Rf bin obj
2016-04-21 15:58:45 +03:00
rm -f $(SIMLAUNCHERS)
$(SYSTEM_XBUILD) /t:Clean /p:Configuration=$(CECIL_CONFIG) $(CECIL_PATH)/Mono.Cecil.csproj
$(SYSTEM_XBUILD) /t:Clean /p:Configuration=$(CECIL_CONFIG) $(CECIL_PATH)/symbols/mdb/Mono.Cecil.Mdb.csproj
include $(TOP)/mk/rules.mk
# make will automatically consider files created in chained implicit rules as temporary files, and delete them afterwards
# marking those files as .SECONDARY will prevent that deletion.
.SECONDARY: $(foreach ext,a h m,Xamarin.iOS.registrar.ios.i386.$(ext) Xamarin.iOS.registrar.ios.x86_64.$(ext))
.SECONDARY: $(foreach ext,a h m,Xamarin.WatchOS.registrar.watchos.$(ext))
.SECONDARY: $(foreach ext,a h m,Xamarin.TVOS.registrar.tvos.$(ext))