Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Safar <marek.safar@gmail.com>2016-04-04 14:42:47 +0300
committerMarek Safar <marek.safar@gmail.com>2016-04-04 14:48:44 +0300
commitaeccd22792f34fb77c340180174f73f6c3270200 (patch)
tree21343b9a17eb47414f28daba4a29d2f7b959b6ec
parent3d180029fb2875865d51d03269cc71999e008104 (diff)
[build] Change the way how mcs references are passed to compiler to always use full path.
One of csc prerequisites because csc uses -lib as path which is considered after RuntimeEnvironment.GetRuntimeDirectory which makes -lib useless
-rw-r--r--docs/docs.make4
-rw-r--r--mcs/build/executable.make11
-rw-r--r--mcs/build/library.make8
-rw-r--r--mcs/build/profiles/build.make4
-rw-r--r--mcs/build/profiles/mobile.make3
-rw-r--r--mcs/build/profiles/mobile_static.make3
-rw-r--r--mcs/build/profiles/monodroid.make3
-rw-r--r--mcs/build/profiles/monotouch_runtime.make3
-rw-r--r--mcs/build/profiles/net_4_x.make4
-rw-r--r--mcs/build/profiles/xammac.make3
-rw-r--r--mcs/build/profiles/xbuild_12.make6
-rw-r--r--mcs/build/profiles/xbuild_14.make4
-rw-r--r--mcs/build/rules.make5
-rw-r--r--mcs/build/tests.make10
-rw-r--r--mcs/class/Accessibility/Makefile2
-rw-r--r--mcs/class/Commons.Xml.Relaxng/Makefile2
-rw-r--r--mcs/class/Compat.ICSharpCode.SharpZipLib/Makefile2
-rw-r--r--mcs/class/Cscompmgd/Makefile2
-rw-r--r--mcs/class/CustomMarshalers/Makefile2
-rw-r--r--mcs/class/Facades/Microsoft.Win32.Primitives/Makefile2
-rw-r--r--mcs/class/Facades/Microsoft.Win32.Registry.AccessControl/Makefile2
-rw-r--r--mcs/class/Facades/Microsoft.Win32.Registry/Makefile2
-rw-r--r--mcs/class/Facades/System.AppContext/Makefile2
-rw-r--r--mcs/class/Facades/System.Collections.Concurrent/Makefile2
-rw-r--r--mcs/class/Facades/System.Collections.NonGeneric/Makefile2
-rw-r--r--mcs/class/Facades/System.Collections.Specialized/Makefile2
-rw-r--r--mcs/class/Facades/System.Collections/Makefile2
-rw-r--r--mcs/class/Facades/System.ComponentModel.Annotations/Makefile2
-rw-r--r--mcs/class/Facades/System.ComponentModel.EventBasedAsync/Makefile2
-rw-r--r--mcs/class/Facades/System.ComponentModel.Primitives/Makefile2
-rw-r--r--mcs/class/Facades/System.ComponentModel.TypeConverter/Makefile2
-rw-r--r--mcs/class/Facades/System.ComponentModel/Makefile2
-rw-r--r--mcs/class/Facades/System.Console/Makefile2
-rw-r--r--mcs/class/Facades/System.Data.Common/Makefile4
-rw-r--r--mcs/class/Facades/System.Data.SqlClient/Makefile4
-rw-r--r--mcs/class/Facades/System.Diagnostics.Contracts/Makefile2
-rw-r--r--mcs/class/Facades/System.Diagnostics.Debug/Makefile2
-rw-r--r--mcs/class/Facades/System.Diagnostics.FileVersionInfo/Makefile2
-rw-r--r--mcs/class/Facades/System.Diagnostics.PerformanceCounter/Makefile2
-rw-r--r--mcs/class/Facades/System.Diagnostics.Process/Makefile2
-rw-r--r--mcs/class/Facades/System.Diagnostics.StackTrace/Makefile2
-rw-r--r--mcs/class/Facades/System.Diagnostics.TextWriterTraceListener/Makefile2
-rw-r--r--mcs/class/Facades/System.Diagnostics.Tools/Makefile2
-rw-r--r--mcs/class/Facades/System.Diagnostics.TraceEvent/Makefile2
-rw-r--r--mcs/class/Facades/System.Diagnostics.TraceSource/Makefile2
-rw-r--r--mcs/class/Facades/System.Diagnostics.Tracing/Makefile2
-rw-r--r--mcs/class/Facades/System.Dynamic.Runtime/Makefile2
-rw-r--r--mcs/class/Facades/System.Globalization.Calendars/Makefile2
-rw-r--r--mcs/class/Facades/System.Globalization.Extensions/Makefile2
-rw-r--r--mcs/class/Facades/System.Globalization/Makefile2
-rw-r--r--mcs/class/Facades/System.IO.Compression.ZipFile/Makefile4
-rw-r--r--mcs/class/Facades/System.IO.FileSystem.AccessControl/Makefile2
-rw-r--r--mcs/class/Facades/System.IO.FileSystem.DriveInfo/Makefile2
-rw-r--r--mcs/class/Facades/System.IO.FileSystem.Primitives/Makefile2
-rw-r--r--mcs/class/Facades/System.IO.FileSystem.Watcher/Makefile2
-rw-r--r--mcs/class/Facades/System.IO.FileSystem/Makefile2
-rw-r--r--mcs/class/Facades/System.IO.IsolatedStorage/Makefile2
-rw-r--r--mcs/class/Facades/System.IO.MemoryMappedFiles/Makefile4
-rw-r--r--mcs/class/Facades/System.IO.Pipes/Makefile4
-rw-r--r--mcs/class/Facades/System.IO.UnmanagedMemoryStream/Makefile2
-rw-r--r--mcs/class/Facades/System.IO/Makefile2
-rw-r--r--mcs/class/Facades/System.Linq.Expressions/Makefile2
-rw-r--r--mcs/class/Facades/System.Linq.Parallel/Makefile2
-rw-r--r--mcs/class/Facades/System.Linq.Queryable/Makefile2
-rw-r--r--mcs/class/Facades/System.Linq/Makefile2
-rw-r--r--mcs/class/Facades/System.Net.AuthenticationManager/Makefile2
-rw-r--r--mcs/class/Facades/System.Net.Cache/Makefile2
-rw-r--r--mcs/class/Facades/System.Net.Http.WebRequestHandler/Makefile4
-rw-r--r--mcs/class/Facades/System.Net.HttpListener/Makefile2
-rw-r--r--mcs/class/Facades/System.Net.Mail/Makefile2
-rw-r--r--mcs/class/Facades/System.Net.NameResolution/Makefile2
-rw-r--r--mcs/class/Facades/System.Net.NetworkInformation/Makefile2
-rw-r--r--mcs/class/Facades/System.Net.Primitives/Makefile2
-rw-r--r--mcs/class/Facades/System.Net.Requests/Makefile2
-rw-r--r--mcs/class/Facades/System.Net.Security/Makefile2
-rw-r--r--mcs/class/Facades/System.Net.ServicePoint/Makefile2
-rw-r--r--mcs/class/Facades/System.Net.Sockets/Makefile2
-rw-r--r--mcs/class/Facades/System.Net.Utilities/Makefile2
-rw-r--r--mcs/class/Facades/System.Net.WebHeaderCollection/Makefile2
-rw-r--r--mcs/class/Facades/System.Net.WebSockets.Client/Makefile2
-rw-r--r--mcs/class/Facades/System.Net.WebSockets/Makefile2
-rw-r--r--mcs/class/Facades/System.ObjectModel/Makefile2
-rw-r--r--mcs/class/Facades/System.Private.CoreLib.InteropServices/Makefile2
-rw-r--r--mcs/class/Facades/System.Private.CoreLib.Threading/Makefile2
-rw-r--r--mcs/class/Facades/System.Reflection.Emit.ILGeneration/Makefile2
-rw-r--r--mcs/class/Facades/System.Reflection.Emit.Lightweight/Makefile2
-rw-r--r--mcs/class/Facades/System.Reflection.Emit/Makefile2
-rw-r--r--mcs/class/Facades/System.Reflection.Extensions/Makefile2
-rw-r--r--mcs/class/Facades/System.Reflection.Primitives/Makefile2
-rw-r--r--mcs/class/Facades/System.Reflection.TypeExtensions/Makefile2
-rw-r--r--mcs/class/Facades/System.Reflection/Makefile2
-rw-r--r--mcs/class/Facades/System.Resources.ReaderWriter/Makefile2
-rw-r--r--mcs/class/Facades/System.Resources.ResourceManager/Makefile2
-rw-r--r--mcs/class/Facades/System.Runtime.CompilerServices.VisualC/Makefile2
-rw-r--r--mcs/class/Facades/System.Runtime.Extensions/Makefile2
-rw-r--r--mcs/class/Facades/System.Runtime.Handles/Makefile2
-rw-r--r--mcs/class/Facades/System.Runtime.InteropServices.WindowsRuntime/Makefile2
-rw-r--r--mcs/class/Facades/System.Runtime.InteropServices/Makefile2
-rw-r--r--mcs/class/Facades/System.Runtime.Numerics/Makefile2
-rw-r--r--mcs/class/Facades/System.Runtime.Serialization.Json/Makefile2
-rw-r--r--mcs/class/Facades/System.Runtime.Serialization.Primitives/Makefile2
-rw-r--r--mcs/class/Facades/System.Runtime.Serialization.Xml/Makefile2
-rw-r--r--mcs/class/Facades/System.Runtime/Makefile2
-rw-r--r--mcs/class/Facades/System.Security.AccessControl/Makefile2
-rw-r--r--mcs/class/Facades/System.Security.Claims/Makefile2
-rw-r--r--mcs/class/Facades/System.Security.Cryptography.DeriveBytes/Makefile2
-rw-r--r--mcs/class/Facades/System.Security.Cryptography.Encoding/Makefile2
-rw-r--r--mcs/class/Facades/System.Security.Cryptography.Encryption.Aes/Makefile2
-rw-r--r--mcs/class/Facades/System.Security.Cryptography.Encryption.ECDiffieHellman/Makefile4
-rw-r--r--mcs/class/Facades/System.Security.Cryptography.Encryption.ECDsa/Makefile4
-rw-r--r--mcs/class/Facades/System.Security.Cryptography.Encryption/Makefile2
-rw-r--r--mcs/class/Facades/System.Security.Cryptography.Hashing.Algorithms/Makefile2
-rw-r--r--mcs/class/Facades/System.Security.Cryptography.Hashing/Makefile2
-rw-r--r--mcs/class/Facades/System.Security.Cryptography.ProtectedData/Makefile4
-rw-r--r--mcs/class/Facades/System.Security.Cryptography.RSA/Makefile2
-rw-r--r--mcs/class/Facades/System.Security.Cryptography.RandomNumberGenerator/Makefile2
-rw-r--r--mcs/class/Facades/System.Security.Cryptography.X509Certificates/Makefile2
-rw-r--r--mcs/class/Facades/System.Security.Principal.Windows/Makefile2
-rw-r--r--mcs/class/Facades/System.Security.Principal/Makefile2
-rw-r--r--mcs/class/Facades/System.Security.SecureString/Makefile2
-rw-r--r--mcs/class/Facades/System.ServiceModel.Duplex/Makefile2
-rw-r--r--mcs/class/Facades/System.ServiceModel.Http/Makefile2
-rw-r--r--mcs/class/Facades/System.ServiceModel.NetTcp/Makefile2
-rw-r--r--mcs/class/Facades/System.ServiceModel.Primitives/Makefile2
-rw-r--r--mcs/class/Facades/System.ServiceModel.Security/Makefile2
-rw-r--r--mcs/class/Facades/System.ServiceProcess.ServiceController/Makefile4
-rw-r--r--mcs/class/Facades/System.Text.Encoding.Extensions/Makefile2
-rw-r--r--mcs/class/Facades/System.Text.Encoding/Makefile2
-rw-r--r--mcs/class/Facades/System.Text.RegularExpressions/Makefile2
-rw-r--r--mcs/class/Facades/System.Threading.AccessControl/Makefile2
-rw-r--r--mcs/class/Facades/System.Threading.Overlapped/Makefile2
-rw-r--r--mcs/class/Facades/System.Threading.Tasks.Parallel/Makefile2
-rw-r--r--mcs/class/Facades/System.Threading.Tasks/Makefile2
-rw-r--r--mcs/class/Facades/System.Threading.Thread/Makefile2
-rw-r--r--mcs/class/Facades/System.Threading.ThreadPool/Makefile2
-rw-r--r--mcs/class/Facades/System.Threading.Timer/Makefile2
-rw-r--r--mcs/class/Facades/System.Threading/Makefile2
-rw-r--r--mcs/class/Facades/System.Xml.ReaderWriter/Makefile2
-rw-r--r--mcs/class/Facades/System.Xml.XDocument/Makefile2
-rw-r--r--mcs/class/Facades/System.Xml.XPath.XDocument/Makefile4
-rw-r--r--mcs/class/Facades/System.Xml.XPath/Makefile4
-rw-r--r--mcs/class/Facades/System.Xml.XmlDocument/Makefile4
-rw-r--r--mcs/class/Facades/System.Xml.XmlSerializer/Makefile2
-rw-r--r--mcs/class/Facades/System.Xml.Xsl.Primitives/Makefile4
-rw-r--r--mcs/class/I18N/CJK/Makefile4
-rw-r--r--mcs/class/I18N/Common/Makefile2
-rw-r--r--mcs/class/I18N/MidEast/Makefile5
-rw-r--r--mcs/class/I18N/Other/Makefile3
-rw-r--r--mcs/class/I18N/Rare/Makefile3
-rw-r--r--mcs/class/I18N/West/Makefile3
-rw-r--r--mcs/class/IBM.Data.DB2/Makefile2
-rw-r--r--mcs/class/ICSharpCode.SharpZipLib/Makefile2
-rw-r--r--mcs/class/Microsoft.Build.Engine/Makefile24
-rw-r--r--mcs/class/Microsoft.Build.Framework/Makefile6
-rw-r--r--mcs/class/Microsoft.Build.Tasks/Makefile28
-rw-r--r--mcs/class/Microsoft.Build.Utilities/Makefile12
-rw-r--r--mcs/class/Microsoft.Build/Makefile12
-rw-r--r--mcs/class/Microsoft.VisualC/Makefile2
-rw-r--r--mcs/class/Mono.C5/Makefile2
-rw-r--r--mcs/class/Mono.CSharp/Makefile7
-rw-r--r--mcs/class/Mono.Cecil.Mdb/Makefile2
-rw-r--r--mcs/class/Mono.Cecil/Makefile2
-rw-r--r--mcs/class/Mono.CodeContracts/Makefile4
-rw-r--r--mcs/class/Mono.Data.Tds/Makefile5
-rw-r--r--mcs/class/Mono.Debugger.Soft/Makefile9
-rw-r--r--mcs/class/Mono.Directory.LDAP/Makefile2
-rw-r--r--mcs/class/Mono.Dynamic.Interpreter/Makefile6
-rw-r--r--mcs/class/Mono.Http/Makefile3
-rw-r--r--mcs/class/Mono.Management/Makefile2
-rw-r--r--mcs/class/Mono.Messaging.RabbitMQ/Makefile4
-rw-r--r--mcs/class/Mono.Messaging/Makefile3
-rw-r--r--mcs/class/Mono.Options/Makefile5
-rw-r--r--mcs/class/Mono.Parallel/Makefile5
-rw-r--r--mcs/class/Mono.Posix/Makefile5
-rw-r--r--mcs/class/Mono.Security.Providers.NewTls/Makefile4
-rw-r--r--mcs/class/Mono.Security/Makefile2
-rw-r--r--mcs/class/Mono.Simd/Makefile3
-rw-r--r--mcs/class/Mono.XBuild.Tasks/Makefile7
-rw-r--r--mcs/class/Mono.Xml.Ext/Makefile2
-rw-r--r--mcs/class/Novell.Directory.Ldap/Makefile3
-rw-r--r--mcs/class/PEAPI/Makefile2
-rw-r--r--mcs/class/RabbitMQ.Client/src/apigen/Makefile6
-rw-r--r--mcs/class/System.Configuration.Install/Makefile2
-rw-r--r--mcs/class/System.Configuration/Makefile10
-rw-r--r--mcs/class/System.Data.OracleClient/Makefile2
-rw-r--r--mcs/class/System.Data.Services/Makefile3
-rw-r--r--mcs/class/System.Data/Makefile3
-rw-r--r--mcs/class/System.Design/Makefile10
-rw-r--r--mcs/class/System.DirectoryServices/Makefile2
-rw-r--r--mcs/class/System.Drawing.Design/Makefile2
-rw-r--r--mcs/class/System.Drawing/Makefile5
-rw-r--r--mcs/class/System.EnterpriseServices/Makefile2
-rw-r--r--mcs/class/System.IO.Compression.FileSystem/Makefile3
-rw-r--r--mcs/class/System.IO.Compression/Makefile3
-rw-r--r--mcs/class/System.IdentityModel/Makefile13
-rw-r--r--mcs/class/System.Management/Makefile2
-rw-r--r--mcs/class/System.Messaging/Makefile4
-rw-r--r--mcs/class/System.Net.Http.WebRequest/Makefile3
-rw-r--r--mcs/class/System.Net.Http/Makefile3
-rw-r--r--mcs/class/System.Reactive.Core/Makefile3
-rw-r--r--mcs/class/System.Reactive.Linq/Makefile3
-rw-r--r--mcs/class/System.Reactive.Observable.Aliases/Makefile3
-rw-r--r--mcs/class/System.Reactive.PlatformServices/Makefile6
-rw-r--r--mcs/class/System.Reactive.Providers/Makefile3
-rw-r--r--mcs/class/System.Reactive.Runtime.Remoting/Makefile3
-rw-r--r--mcs/class/System.Reactive.Windows.Forms/Makefile3
-rw-r--r--mcs/class/System.Reactive.Windows.Threading/Makefile3
-rw-r--r--mcs/class/System.Runtime.Remoting/Makefile5
-rw-r--r--mcs/class/System.Runtime.Serialization.Formatters.Soap/Makefile6
-rw-r--r--mcs/class/System.Runtime.Serialization/Makefile4
-rw-r--r--mcs/class/System.Security/Makefile3
-rw-r--r--mcs/class/System.ServiceModel.Activation/Makefile9
-rw-r--r--mcs/class/System.ServiceModel.Discovery/Makefile3
-rw-r--r--mcs/class/System.ServiceModel.Routing/Makefile3
-rw-r--r--mcs/class/System.ServiceModel/Makefile3
-rw-r--r--mcs/class/System.Threading.Tasks.Dataflow/Makefile5
-rw-r--r--mcs/class/System.Transactions/Makefile4
-rw-r--r--mcs/class/System.Web.DynamicData/Makefile6
-rw-r--r--mcs/class/System.Web.Extensions/Makefile14
-rw-r--r--mcs/class/System.Web.Services/Makefile19
-rw-r--r--mcs/class/System.Web/Makefile16
-rw-r--r--mcs/class/System.Web/Test/tools/Makefile11
-rw-r--r--mcs/class/System.Windows.Forms/Makefile7
-rw-r--r--mcs/class/System.XML/Makefile19
-rw-r--r--mcs/class/System/Makefile16
-rw-r--r--mcs/class/WebMatrix.Data/Makefile5
-rw-r--r--mcs/class/WindowsBase/Makefile5
-rw-r--r--mcs/class/corlib/Makefile20
-rw-r--r--mcs/class/monodoc/Makefile5
-rw-r--r--mcs/nunit24/ClientUtilities/util/Makefile7
-rw-r--r--mcs/nunit24/ConsoleRunner/nunit-console-exe/Makefile6
-rw-r--r--mcs/nunit24/ConsoleRunner/nunit-console/Makefile6
-rw-r--r--mcs/nunit24/NUnitCore/core/Makefile3
-rw-r--r--mcs/nunit24/NUnitCore/interfaces/Makefile3
-rw-r--r--mcs/nunit24/NUnitExtensions/core/Makefile6
-rw-r--r--mcs/nunit24/NUnitExtensions/framework/Makefile3
-rw-r--r--mcs/nunit24/NUnitFramework/framework/Makefile3
-rw-r--r--mcs/nunit24/NUnitMocks/mocks/Makefile3
-rw-r--r--mcs/tools/Makefile1
-rw-r--r--mcs/tools/al/Makefile3
-rw-r--r--mcs/tools/browsercaps-updater/Makefile3
-rw-r--r--mcs/tools/cccheck/Makefile3
-rw-r--r--mcs/tools/ccrewrite/Makefile3
-rw-r--r--mcs/tools/cil-stringreplacer/Makefile2
-rw-r--r--mcs/tools/cil-strip/Makefile3
-rw-r--r--mcs/tools/compiler-tester/Makefile3
-rw-r--r--mcs/tools/corcompare/Makefile62
-rw-r--r--mcs/tools/corcompare/mono-api-info.exe.sources5
-rw-r--r--mcs/tools/csharp/Makefile3
-rw-r--r--mcs/tools/culevel/Makefile2
-rw-r--r--mcs/tools/disco/Makefile3
-rw-r--r--mcs/tools/dtd2rng/Makefile3
-rwxr-xr-xmcs/tools/dtd2xsd/Makefile3
-rw-r--r--mcs/tools/gacutil/Makefile3
-rw-r--r--mcs/tools/genxs/Makefile3
-rw-r--r--mcs/tools/ictool/Makefile3
-rw-r--r--mcs/tools/ikdasm/Makefile4
-rw-r--r--mcs/tools/installutil/Makefile3
-rw-r--r--mcs/tools/installvst/Makefile3
-rw-r--r--mcs/tools/lc/Makefile3
-rw-r--r--mcs/tools/linker-analyzer/Makefile3
-rw-r--r--mcs/tools/linker/Makefile7
-rw-r--r--mcs/tools/mconfig/Makefile3
-rw-r--r--mcs/tools/mdbdump/Makefile6
-rw-r--r--mcs/tools/mdbrebase/Makefile4
-rw-r--r--mcs/tools/mdoc/Makefile42
-rw-r--r--mcs/tools/mkbundle/Makefile3
-rw-r--r--mcs/tools/mod/Makefile3
-rw-r--r--mcs/tools/mono-api-html/ApiChange.cs (renamed from mcs/tools/corcompare/mono-api-html/ApiChange.cs)0
-rw-r--r--mcs/tools/mono-api-html/ApiDiff.cs (renamed from mcs/tools/corcompare/mono-api-html/ApiDiff.cs)0
-rw-r--r--mcs/tools/mono-api-html/AssemblyComparer.cs (renamed from mcs/tools/corcompare/mono-api-html/AssemblyComparer.cs)0
-rw-r--r--mcs/tools/mono-api-html/ClassComparer.cs (renamed from mcs/tools/corcompare/mono-api-html/ClassComparer.cs)0
-rw-r--r--mcs/tools/mono-api-html/Comparer.cs (renamed from mcs/tools/corcompare/mono-api-html/Comparer.cs)0
-rw-r--r--mcs/tools/mono-api-html/ConstructorComparer.cs (renamed from mcs/tools/corcompare/mono-api-html/ConstructorComparer.cs)0
-rw-r--r--mcs/tools/mono-api-html/EventComparer.cs (renamed from mcs/tools/corcompare/mono-api-html/EventComparer.cs)0
-rw-r--r--mcs/tools/mono-api-html/FieldComparer.cs (renamed from mcs/tools/corcompare/mono-api-html/FieldComparer.cs)0
-rw-r--r--mcs/tools/mono-api-html/Helpers.cs (renamed from mcs/tools/corcompare/mono-api-html/Helpers.cs)0
-rw-r--r--mcs/tools/mono-api-html/InterfaceComparer.cs (renamed from mcs/tools/corcompare/mono-api-html/InterfaceComparer.cs)0
-rw-r--r--mcs/tools/mono-api-html/Makefile10
-rw-r--r--mcs/tools/mono-api-html/MemberComparer.cs (renamed from mcs/tools/corcompare/mono-api-html/MemberComparer.cs)0
-rw-r--r--mcs/tools/mono-api-html/MethodComparer.cs (renamed from mcs/tools/corcompare/mono-api-html/MethodComparer.cs)0
-rw-r--r--mcs/tools/mono-api-html/NamespaceComparer.cs (renamed from mcs/tools/corcompare/mono-api-html/NamespaceComparer.cs)0
-rw-r--r--mcs/tools/mono-api-html/PropertyComparer.cs (renamed from mcs/tools/corcompare/mono-api-html/PropertyComparer.cs)0
-rw-r--r--mcs/tools/mono-api-html/mono-api-html.csproj (renamed from mcs/tools/corcompare/mono-api-html/mono-api-html.csproj)0
-rw-r--r--mcs/tools/mono-api-html/mono-api-html.exe.sources15
-rw-r--r--mcs/tools/mono-configuration-crypto/cli/Makefile7
-rw-r--r--mcs/tools/mono-configuration-crypto/lib/Makefile3
-rw-r--r--mcs/tools/mono-service/Makefile5
-rw-r--r--mcs/tools/mono-shlib-cop/Makefile3
-rw-r--r--mcs/tools/mono-symbolicate/Makefile13
-rw-r--r--mcs/tools/mono-xmltool/Makefile3
-rw-r--r--mcs/tools/mono-xsd/Makefile3
-rw-r--r--mcs/tools/monop/Makefile3
-rw-r--r--mcs/tools/msbuild/Makefile9
-rw-r--r--mcs/tools/nunit-lite/NUnitLite/Makefile3
-rw-r--r--mcs/tools/nunit-lite/nunit-lite-console/Makefile3
-rw-r--r--mcs/tools/nunitreport/Makefile3
-rw-r--r--mcs/tools/pdb2mdb/Makefile6
-rw-r--r--mcs/tools/resgen/Makefile2
-rw-r--r--mcs/tools/security/Makefile9
-rw-r--r--mcs/tools/security/certview/Makefile3
-rw-r--r--mcs/tools/sgen/Makefile3
-rw-r--r--mcs/tools/soapsuds/Makefile3
-rw-r--r--mcs/tools/sqlmetal/Makefile9
-rw-r--r--mcs/tools/sqlsharp/Makefile3
-rw-r--r--mcs/tools/svcutil/Makefile10
-rw-r--r--mcs/tools/tuner/Makefile6
-rw-r--r--mcs/tools/wsdl/Makefile3
-rw-r--r--mcs/tools/xbuild/Makefile3
-rw-r--r--mcs/tools/xbuild/xbuild.make12
-rwxr-xr-xmono/mini/Makefile.am.in8
311 files changed, 615 insertions, 632 deletions
diff --git a/docs/docs.make b/docs/docs.make
index c19ba5c3375..f0b97990356 100644
--- a/docs/docs.make
+++ b/docs/docs.make
@@ -13,10 +13,10 @@ ASSEMBLED_DOCS = \
monoapi.tree monoapi.zip
convert.exe: $(srcdir)/convert.cs AgilityPack.dll
- $(CSCOMPILE) -r:System.Xml.dll -out:$@ $< -r:AgilityPack.dll
+ $(CSCOMPILE) -r:$(topdir)/class/lib/$(PROFILE)/System.Xml.dll -out:$@ $< -r:AgilityPack.dll
AgilityPack.dll:
- $(CSCOMPILE) -r:System.dll -r:System.Xml.dll -target:library -out:$@ $(srcdir)/HtmlAgilityPack/*.cs
+ $(CSCOMPILE) -r:$(topdir)/class/lib/$(PROFILE)/System.dll -r:$(topdir)/class/lib/$(PROFILE)/System.Xml.dll -target:library -out:$@ $(srcdir)/HtmlAgilityPack/*.cs
monoapi.zip: monoapi.tree
@test -f $@ || { rm -f $< && $(MAKE) $<; }
diff --git a/mcs/build/executable.make b/mcs/build/executable.make
index 7ac3b338462..29ba89909e6 100644
--- a/mcs/build/executable.make
+++ b/mcs/build/executable.make
@@ -31,6 +31,9 @@ ifdef base_prog_config
PROGRAM_config := $(build_libdir)$(PROGRAM).config
endif
+sn = $(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)/sn.exe
+SN = MONO_PATH="$(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(RUNTIME) $(RUNTIME_FLAGS) $(sn) -q
+
the_lib = $(the_libdir)$(base_prog)
build_lib = $(build_libdir)$(base_prog)
@@ -110,7 +113,10 @@ endif
$(the_lib): $(the_libdir)/.stamp
$(build_lib): $(BUILT_SOURCES) $(EXTRA_SOURCES) $(response) $(build_libdir:=/.stamp)
- $(PROGRAM_COMPILE) -target:exe -out:$@ $(BUILT_SOURCES) $(EXTRA_SOURCES) @$(response)
+ $(PROGRAM_COMPILE) $(MCS_REFERENCES) -target:exe -out:$@ $(BUILT_SOURCES) $(EXTRA_SOURCES) @$(response)
+ifdef PROGRAM_SNK
+ $(Q) $(SN) -R $@ $(PROGRAM_SNK)
+endif
ifdef PROGRAM_USE_INTERMEDIATE_FILE
$(the_lib): $(build_lib)
@@ -143,6 +149,9 @@ endif
-include $(makefrag)
+MCS_REFERENCES = $(patsubst %,-r:$(topdir)/class/lib/$(PROFILE)/%.dll,$(LIB_REFS))
+MCS_REFERENCES += $(patsubst %,-r:$(topdir)/class/lib/$(PROFILE)/%.exe,$(EXE_REFS))
+
all-local: $(makefrag) $(extra_targets)
csproj-local:
diff --git a/mcs/build/library.make b/mcs/build/library.make
index 1df98aeea1f..acaa9387121 100644
--- a/mcs/build/library.make
+++ b/mcs/build/library.make
@@ -18,7 +18,13 @@
# Have to rename to handle differences between assembly/directory names
DEP_LIBS=$(patsubst System.Xml,System.XML,$(LIB_REFS))
-LIB_MCS_FLAGS += $(patsubst %,-r:%.dll,$(LIB_REFS))
+_FILTER_OUT = $(foreach x,$(2),$(if $(findstring $(1),$(x)),,$(x)))
+
+LIB_REFS_FULL = $(call _FILTER_OUT,=, $(LIB_REFS))
+LIB_REFS_ALIAS = $(filter-out $(LIB_REFS_FULL),$(LIB_REFS))
+
+LIB_MCS_FLAGS += $(patsubst %,-r:$(topdir)/class/lib/$(PROFILE)/%.dll,$(LIB_REFS_FULL))
+LIB_MCS_FLAGS += $(patsubst %,-r:%.dll, $(subst =,=$(topdir)/class/lib/$(PROFILE)/,$(LIB_REFS_ALIAS)))
sourcefile = $(LIBRARY).sources
diff --git a/mcs/build/profiles/build.make b/mcs/build/profiles/build.make
index 5273928a0ed..3b4c7e0706e 100644
--- a/mcs/build/profiles/build.make
+++ b/mcs/build/profiles/build.make
@@ -12,8 +12,8 @@ MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARAT
profile-check:
@:
-DEFAULT_REFERENCES = -r:mscorlib.dll
-PROFILE_MCS_FLAGS = -d:NET_4_0 -d:NET_4_5 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:$(topdir)/class/lib/$(PROFILE) $(DEFAULT_REFERENCES)
+DEFAULT_REFERENCES = -r:$(topdir)/class/lib/$(PROFILE)/mscorlib.dll
+PROFILE_MCS_FLAGS = -d:NET_4_0 -d:NET_4_5 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib $(DEFAULT_REFERENCES)
NO_SIGN_ASSEMBLY = yes
NO_TEST = yes
diff --git a/mcs/build/profiles/mobile.make b/mcs/build/profiles/mobile.make
index 6f6108c08aa..70908afa4e1 100644
--- a/mcs/build/profiles/mobile.make
+++ b/mcs/build/profiles/mobile.make
@@ -11,7 +11,7 @@ RESGEN = resgen2
profile-check:
@:
-DEFAULT_REFERENCES = -r:mscorlib.dll
+DEFAULT_REFERENCES = -r:$(topdir)/class/lib/$(PROFILE)/mscorlib.dll
PROFILE_MCS_FLAGS = \
-d:NET_1_1 \
@@ -26,7 +26,6 @@ PROFILE_MCS_FLAGS = \
-d:DISABLE_CAS_USE \
-nowarn:1699 \
-nostdlib \
- -lib:$(topdir)/class/lib/$(PROFILE) \
$(DEFAULT_REFERENCES) \
$(PLATFORM_DEBUG_FLAGS)
diff --git a/mcs/build/profiles/mobile_static.make b/mcs/build/profiles/mobile_static.make
index 0c3c8125cfd..f13e65d83cc 100644
--- a/mcs/build/profiles/mobile_static.make
+++ b/mcs/build/profiles/mobile_static.make
@@ -11,7 +11,7 @@ RESGEN = resgen2
profile-check:
@:
-DEFAULT_REFERENCES = -r:mscorlib.dll
+DEFAULT_REFERENCES = -r:$(topdir)/class/lib/$(PROFILE)/mscorlib.dll
PROFILE_MCS_FLAGS = \
-d:NET_1_1 \
@@ -28,7 +28,6 @@ PROFILE_MCS_FLAGS = \
-d:DISABLE_COM \
-nowarn:1699 \
-nostdlib \
- -lib:$(topdir)/class/lib/$(PROFILE) \
$(DEFAULT_REFERENCES) \
$(PLATFORM_DEBUG_FLAGS)
diff --git a/mcs/build/profiles/monodroid.make b/mcs/build/profiles/monodroid.make
index 49f85dcf8ee..9ea27d6c9c7 100644
--- a/mcs/build/profiles/monodroid.make
+++ b/mcs/build/profiles/monodroid.make
@@ -11,7 +11,7 @@ RESGEN = resgen2
profile-check:
@:
-DEFAULT_REFERENCES = -r:mscorlib.dll
+DEFAULT_REFERENCES = -r:$(topdir)/class/lib/$(PROFILE)/mscorlib.dll
PROFILE_MCS_FLAGS = \
-d:NET_1_1 \
@@ -28,7 +28,6 @@ PROFILE_MCS_FLAGS = \
-d:ANDROID \
-nowarn:1699 \
-nostdlib \
- -lib:$(topdir)/class/lib/$(PROFILE) \
$(DEFAULT_REFERENCES) \
$(PLATFORM_DEBUG_FLAGS)
diff --git a/mcs/build/profiles/monotouch_runtime.make b/mcs/build/profiles/monotouch_runtime.make
index 7e963cb73c0..f127fd7d190 100644
--- a/mcs/build/profiles/monotouch_runtime.make
+++ b/mcs/build/profiles/monotouch_runtime.make
@@ -13,7 +13,7 @@ RESGEN := $(dir $(shell which $(EXTERNAL_MCS)))resgen2
profile-check:
@:
-DEFAULT_REFERENCES = -r:mscorlib.dll
+DEFAULT_REFERENCES = -r:$(topdir)/class/lib/$(PROFILE)/mscorlib.dll
PROFILE_MCS_FLAGS = \
-d:NET_1_1 \
-d:NET_2_0 \
@@ -30,7 +30,6 @@ PROFILE_MCS_FLAGS = \
-d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK \
-nowarn:1699 \
-nostdlib \
- -lib:$(topdir)/class/lib/$(PROFILE) \
$(DEFAULT_REFERENCES) \
$(PLATFORM_DEBUG_FLAGS)
diff --git a/mcs/build/profiles/net_4_x.make b/mcs/build/profiles/net_4_x.make
index a634dac3928..a93b03b7f6b 100644
--- a/mcs/build/profiles/net_4_x.make
+++ b/mcs/build/profiles/net_4_x.make
@@ -10,8 +10,8 @@ MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARAT
profile-check:
@:
-DEFAULT_REFERENCES = -r:mscorlib.dll
-PROFILE_MCS_FLAGS = -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:$(topdir)/class/lib/$(PROFILE) $(DEFAULT_REFERENCES) $(PLATFORM_DEBUG_FLAGS)
+DEFAULT_REFERENCES = -r:$(topdir)/class/lib/$(PROFILE)/mscorlib.dll
+PROFILE_MCS_FLAGS = -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib $(DEFAULT_REFERENCES) $(PLATFORM_DEBUG_FLAGS)
FRAMEWORK_VERSION = 4.5
XBUILD_VERSION = 4.0
diff --git a/mcs/build/profiles/xammac.make b/mcs/build/profiles/xammac.make
index a9a6ef9ab25..d3cbdb5d972 100644
--- a/mcs/build/profiles/xammac.make
+++ b/mcs/build/profiles/xammac.make
@@ -9,7 +9,7 @@ RESGEN := $(dir $(shell which $(EXTERNAL_MCS)))resgen2
profile-check:
@:
-DEFAULT_REFERENCES = -r:mscorlib.dll
+DEFAULT_REFERENCES = -r:$(topdir)/class/lib/$(PROFILE)/mscorlib.dll
PROFILE_MCS_FLAGS = \
-d:NET_1_1 \
@@ -27,7 +27,6 @@ PROFILE_MCS_FLAGS = \
-d:XAMARIN_MODERN \
-nowarn:1699 \
-nostdlib \
- -lib:$(topdir)/class/lib/$(PROFILE) \
$(DEFAULT_REFERENCES) \
$(PLATFORM_DEBUG_FLAGS)
diff --git a/mcs/build/profiles/xbuild_12.make b/mcs/build/profiles/xbuild_12.make
index 7150d2529e9..a0b681071dd 100644
--- a/mcs/build/profiles/xbuild_12.make
+++ b/mcs/build/profiles/xbuild_12.make
@@ -2,6 +2,10 @@
include $(topdir)/build/profiles/net_4_x.make
-PROFILE_MCS_FLAGS := $(PROFILE_MCS_FLAGS) -d:XBUILD_12 -d:MONO -d:DISABLE_CAS_USE -lib:$(topdir)/class/lib/net_4_x
+PARENT_PROFILE = ../net_4_x/
+DEFAULT_REFERENCES = -r:$(topdir)/class/lib/net_4_x/mscorlib.dll
+PROFILE_MCS_FLAGS := $(PROFILE_MCS_FLAGS) -d:XBUILD_12
+
+RESGEN_EXE = $(topdir)/class/lib/net_4_x/resgen.exe
XBUILD_VERSION = 12.0
diff --git a/mcs/build/profiles/xbuild_14.make b/mcs/build/profiles/xbuild_14.make
index 4e35ffc2305..60809393a62 100644
--- a/mcs/build/profiles/xbuild_14.make
+++ b/mcs/build/profiles/xbuild_14.make
@@ -1,7 +1,7 @@
# -*- makefile -*-
-include $(topdir)/build/profiles/net_4_x.make
+include $(topdir)/build/profiles/xbuild_12.make
-PROFILE_MCS_FLAGS := $(PROFILE_MCS_FLAGS) -d:XBUILD_12 -d:XBUILD_14 -d:MONO -d:DISABLE_CAS_USE -lib:$(topdir)/class/lib/net_4_x
+PROFILE_MCS_FLAGS := $(PROFILE_MCS_FLAGS) -d:XBUILD_14
XBUILD_VERSION = 14.0
diff --git a/mcs/build/rules.make b/mcs/build/rules.make
index 54c946a8730..5fda8826d12 100644
--- a/mcs/build/rules.make
+++ b/mcs/build/rules.make
@@ -43,9 +43,10 @@ MKINSTALLDIRS = $(SHELL) $(topdir)/mkinstalldirs
INTERNAL_MBAS = $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/mbas/mbas.exe
INTERNAL_GMCS = $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)/mcs.exe
INTERNAL_ILASM = $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(PROFILE)/ilasm.exe
-corlib = mscorlib.dll
+INTERNAL_CSC = $(RUNTIME) $(RUNTIME_FLAGS) $(CSC_LOCATION)
-INTERNAL_RESGEN = $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(PROFILE)/resgen.exe
+RESGEN_EXE = $(topdir)/class/lib/$(PROFILE)/resgen.exe
+INTERNAL_RESGEN = $(RUNTIME) $(RUNTIME_FLAGS) $(RESGEN_EXE)
RESGEN = MONO_PATH="$(topdir)/class/lib/$(PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_RESGEN)
STRING_REPLACER = MONO_PATH="$(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)/cil-stringreplacer.exe
diff --git a/mcs/build/tests.make b/mcs/build/tests.make
index e8d52d00332..7f27dd9fd51 100644
--- a/mcs/build/tests.make
+++ b/mcs/build/tests.make
@@ -25,7 +25,9 @@ else
test_nunit_lib = nunit.framework.dll nunit.core.dll nunit.util.dll nunit.mocks.dll
endif
-test_nunit_dep = $(test_nunit_lib:%=$(topdir)/class/lib/$(PROFILE)/%)
+TEST_LIB_MCS_FLAGS = $(patsubst %,-r:$(topdir)/class/lib/$(PROFILE)/%.dll,$(TEST_LIB_REFS))
+
+test_nunit_dep = $(test_nunit_lib:%=$(topdir)/class/lib/$(PROFILE)/$(PARENT_PROFILE)%)
test_nunit_ref = $(test_nunit_dep:%=-r:%)
tests_CLEAN_FILES += TestResult*.xml
@@ -41,7 +43,7 @@ test_sourcefile_excludes = $(test_lib).excludes
test_pdb = $(test_lib:.dll=.pdb)
test_response = $(depsdir)/$(test_lib).response
test_makefrag = $(depsdir)/$(test_lib).makefrag
-test_flags = -r:$(the_assembly) $(test_nunit_ref) $(TEST_MCS_FLAGS)
+test_flags = -r:$(the_assembly) $(test_nunit_ref) $(TEST_MCS_FLAGS) $(TEST_LIB_MCS_FLAGS)
tests_CLEAN_FILES += $(ASSEMBLY:$(ASSEMBLY_EXT)=_test*.dll) $(ASSEMBLY:$(ASSEMBLY_EXT)=_test*.pdb) $(test_response) $(test_makefrag)
ifndef HAVE_CS_TESTS
@@ -58,11 +60,15 @@ $(test_nunit_dep): $(topdir)/build/deps/nunit-$(PROFILE).stamp
ifdef NUNIT_LITE
$(topdir)/build/deps/nunit-$(PROFILE).stamp:
+ifndef PARENT_PROFILE
cd ${topdir}/tools/nunit-lite && $(MAKE)
+endif
echo "stamp" >$@
else
$(topdir)/build/deps/nunit-$(PROFILE).stamp:
+ifndef PARENT_PROFILE
cd ${topdir}/nunit24 && $(MAKE)
+endif
echo "stamp" >$@
endif
diff --git a/mcs/class/Accessibility/Makefile b/mcs/class/Accessibility/Makefile
index 907ce82bb5b..8700935681b 100644
--- a/mcs/class/Accessibility/Makefile
+++ b/mcs/class/Accessibility/Makefile
@@ -3,7 +3,7 @@ SUBDIRS =
include ../../build/rules.make
LIBRARY = Accessibility.dll
-LIB_MCS_FLAGS = /r:$(corlib)
+LIB_MCS_FLAGS =
NO_TEST = yes
include ../../build/library.make
diff --git a/mcs/class/Commons.Xml.Relaxng/Makefile b/mcs/class/Commons.Xml.Relaxng/Makefile
index 1bc0fd2f277..d63e7af0565 100644
--- a/mcs/class/Commons.Xml.Relaxng/Makefile
+++ b/mcs/class/Commons.Xml.Relaxng/Makefile
@@ -8,7 +8,7 @@ OTHER_RES = $(RESOURCE_FILES)
LIBRARY = Commons.Xml.Relaxng.dll
LIB_REFS = System System.Xml
-LIB_MCS_FLAGS = /r:$(corlib) \
+LIB_MCS_FLAGS = \
$(foreach r, $(OTHER_RES), /resource:$(r),$(notdir $(r)))
TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -nowarn:0618 -nowarn:219 -nowarn:169
EXTRA_DISTFILES = \
diff --git a/mcs/class/Compat.ICSharpCode.SharpZipLib/Makefile b/mcs/class/Compat.ICSharpCode.SharpZipLib/Makefile
index 9c11dbac65c..74debbe57e6 100644
--- a/mcs/class/Compat.ICSharpCode.SharpZipLib/Makefile
+++ b/mcs/class/Compat.ICSharpCode.SharpZipLib/Makefile
@@ -8,7 +8,7 @@ LIBRARY_COMPAT = yes
LIBRARY_SNK = SharpZipLib.key
LIB_REFS = System System.Xml
-LIB_MCS_FLAGS = -r:$(corlib)
+LIB_MCS_FLAGS =
NO_TEST = yes
EXTRA_DISTFILES = SharpZipLib.pub $(LIBRARY_SNK)
diff --git a/mcs/class/Cscompmgd/Makefile b/mcs/class/Cscompmgd/Makefile
index 3afddcca8fa..54ff581cee0 100644
--- a/mcs/class/Cscompmgd/Makefile
+++ b/mcs/class/Cscompmgd/Makefile
@@ -4,7 +4,7 @@ include ../../build/rules.make
LIBRARY = Cscompmgd.dll
LIB_REFS = System
-LIB_MCS_FLAGS = /r:$(corlib)
+LIB_MCS_FLAGS =
TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -nowarn:0618 -nowarn:219 -nowarn:169
LIBRARY_NAME = cscompmgd.dll
diff --git a/mcs/class/CustomMarshalers/Makefile b/mcs/class/CustomMarshalers/Makefile
index 0e432dc33b1..366921c583f 100644
--- a/mcs/class/CustomMarshalers/Makefile
+++ b/mcs/class/CustomMarshalers/Makefile
@@ -4,7 +4,7 @@ include ../../build/rules.make
LIBRARY = CustomMarshalers.dll
LIB_REFS = System
-LIB_MCS_FLAGS = /r:$(corlib)
+LIB_MCS_FLAGS =
NO_TEST = yes
include ../../build/library.make
diff --git a/mcs/class/Facades/Microsoft.Win32.Primitives/Makefile b/mcs/class/Facades/Microsoft.Win32.Primitives/Makefile
index 4b0a8ce48f8..d1b93730000 100644
--- a/mcs/class/Facades/Microsoft.Win32.Primitives/Makefile
+++ b/mcs/class/Facades/Microsoft.Win32.Primitives/Makefile
@@ -12,7 +12,7 @@ LIBRARY = Microsoft.Win32.Primitives.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/Microsoft.Win32.Registry.AccessControl/Makefile b/mcs/class/Facades/Microsoft.Win32.Registry.AccessControl/Makefile
index 68c77b28ef9..0b5f4acf6da 100644
--- a/mcs/class/Facades/Microsoft.Win32.Registry.AccessControl/Makefile
+++ b/mcs/class/Facades/Microsoft.Win32.Registry.AccessControl/Makefile
@@ -12,7 +12,7 @@ LIBRARY = Microsoft.Win32.Registry.AccessControl.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/Microsoft.Win32.Registry/Makefile b/mcs/class/Facades/Microsoft.Win32.Registry/Makefile
index 95a931f2a73..5f1030b7c72 100644
--- a/mcs/class/Facades/Microsoft.Win32.Registry/Makefile
+++ b/mcs/class/Facades/Microsoft.Win32.Registry/Makefile
@@ -12,7 +12,7 @@ LIBRARY = Microsoft.Win32.Registry.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.AppContext/Makefile b/mcs/class/Facades/System.AppContext/Makefile
index a428634b310..9170d927e04 100644
--- a/mcs/class/Facades/System.AppContext/Makefile
+++ b/mcs/class/Facades/System.AppContext/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.AppContext.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Collections.Concurrent/Makefile b/mcs/class/Facades/System.Collections.Concurrent/Makefile
index 9fe40d3d849..d94e5d55dd2 100644
--- a/mcs/class/Facades/System.Collections.Concurrent/Makefile
+++ b/mcs/class/Facades/System.Collections.Concurrent/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.Collections.Concurrent.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Collections.NonGeneric/Makefile b/mcs/class/Facades/System.Collections.NonGeneric/Makefile
index 6aa88932bd3..f2f3cdb4772 100644
--- a/mcs/class/Facades/System.Collections.NonGeneric/Makefile
+++ b/mcs/class/Facades/System.Collections.NonGeneric/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.Collections.NonGeneric.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Collections.Specialized/Makefile b/mcs/class/Facades/System.Collections.Specialized/Makefile
index 7730dc6182e..d391fa9ac51 100644
--- a/mcs/class/Facades/System.Collections.Specialized/Makefile
+++ b/mcs/class/Facades/System.Collections.Specialized/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.Collections.Specialized.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Collections/Makefile b/mcs/class/Facades/System.Collections/Makefile
index e91fa63b8d8..dc6dca0073a 100644
--- a/mcs/class/Facades/System.Collections/Makefile
+++ b/mcs/class/Facades/System.Collections/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.Collections.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System System.Core
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.ComponentModel.Annotations/Makefile b/mcs/class/Facades/System.ComponentModel.Annotations/Makefile
index 0e5a336b82c..a4f1cc41c4d 100644
--- a/mcs/class/Facades/System.ComponentModel.Annotations/Makefile
+++ b/mcs/class/Facades/System.ComponentModel.Annotations/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.ComponentModel.Annotations.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System.ComponentModel.DataAnnotations
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.ComponentModel.EventBasedAsync/Makefile b/mcs/class/Facades/System.ComponentModel.EventBasedAsync/Makefile
index 3bb78c16995..48a6b9c11e6 100644
--- a/mcs/class/Facades/System.ComponentModel.EventBasedAsync/Makefile
+++ b/mcs/class/Facades/System.ComponentModel.EventBasedAsync/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.ComponentModel.EventBasedAsync.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.ComponentModel.Primitives/Makefile b/mcs/class/Facades/System.ComponentModel.Primitives/Makefile
index 8b46af0e4c2..dac065757de 100644
--- a/mcs/class/Facades/System.ComponentModel.Primitives/Makefile
+++ b/mcs/class/Facades/System.ComponentModel.Primitives/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.ComponentModel.Primitives.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.ComponentModel.TypeConverter/Makefile b/mcs/class/Facades/System.ComponentModel.TypeConverter/Makefile
index 9479c31e5d5..6062e304a95 100644
--- a/mcs/class/Facades/System.ComponentModel.TypeConverter/Makefile
+++ b/mcs/class/Facades/System.ComponentModel.TypeConverter/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.ComponentModel.TypeConverter.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.ComponentModel/Makefile b/mcs/class/Facades/System.ComponentModel/Makefile
index 57c23bab8fc..33b88f9541e 100644
--- a/mcs/class/Facades/System.ComponentModel/Makefile
+++ b/mcs/class/Facades/System.ComponentModel/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.ComponentModel.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Console/Makefile b/mcs/class/Facades/System.Console/Makefile
index 7ec5ccd75e5..ea7312a4d70 100644
--- a/mcs/class/Facades/System.Console/Makefile
+++ b/mcs/class/Facades/System.Console/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.Console.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Data.Common/Makefile b/mcs/class/Facades/System.Data.Common/Makefile
index ca5b55bb5e4..30bf3dd0181 100644
--- a/mcs/class/Facades/System.Data.Common/Makefile
+++ b/mcs/class/Facades/System.Data.Common/Makefile
@@ -11,8 +11,8 @@ LIBRARY = System.Data.Common.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll /r:System.Data.dll
+LIB_REFS = System System.Data
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Data.SqlClient/Makefile b/mcs/class/Facades/System.Data.SqlClient/Makefile
index 0fa130c8e28..f5eb7097fd6 100644
--- a/mcs/class/Facades/System.Data.SqlClient/Makefile
+++ b/mcs/class/Facades/System.Data.SqlClient/Makefile
@@ -11,8 +11,8 @@ LIBRARY = System.Data.SqlClient.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll /r:System.Data.dll /r:System.Xml.dll
+LIB_REFS = System System.Data System.Xml
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Diagnostics.Contracts/Makefile b/mcs/class/Facades/System.Diagnostics.Contracts/Makefile
index 23dad544fc9..391da57605b 100644
--- a/mcs/class/Facades/System.Diagnostics.Contracts/Makefile
+++ b/mcs/class/Facades/System.Diagnostics.Contracts/Makefile
@@ -11,7 +11,7 @@ LIBRARY = System.Diagnostics.Contracts.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Diagnostics.Debug/Makefile b/mcs/class/Facades/System.Diagnostics.Debug/Makefile
index 34574abc438..0eccd876719 100644
--- a/mcs/class/Facades/System.Diagnostics.Debug/Makefile
+++ b/mcs/class/Facades/System.Diagnostics.Debug/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.Diagnostics.Debug.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Diagnostics.FileVersionInfo/Makefile b/mcs/class/Facades/System.Diagnostics.FileVersionInfo/Makefile
index 2d2c4bfe8bb..1ac2f6cc2a0 100644
--- a/mcs/class/Facades/System.Diagnostics.FileVersionInfo/Makefile
+++ b/mcs/class/Facades/System.Diagnostics.FileVersionInfo/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.Diagnostics.FileVersionInfo.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Diagnostics.PerformanceCounter/Makefile b/mcs/class/Facades/System.Diagnostics.PerformanceCounter/Makefile
index 499d313fc6c..beda8606888 100644
--- a/mcs/class/Facades/System.Diagnostics.PerformanceCounter/Makefile
+++ b/mcs/class/Facades/System.Diagnostics.PerformanceCounter/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.Diagnostics.PerformanceCounter.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Diagnostics.Process/Makefile b/mcs/class/Facades/System.Diagnostics.Process/Makefile
index c6980725fd1..83fd768e251 100644
--- a/mcs/class/Facades/System.Diagnostics.Process/Makefile
+++ b/mcs/class/Facades/System.Diagnostics.Process/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.Diagnostics.Process.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Diagnostics.StackTrace/Makefile b/mcs/class/Facades/System.Diagnostics.StackTrace/Makefile
index 169d8b79e1e..25d8ac37edd 100644
--- a/mcs/class/Facades/System.Diagnostics.StackTrace/Makefile
+++ b/mcs/class/Facades/System.Diagnostics.StackTrace/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.Diagnostics.StackTrace.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Diagnostics.TextWriterTraceListener/Makefile b/mcs/class/Facades/System.Diagnostics.TextWriterTraceListener/Makefile
index 27e24e5ed7a..aa7c6dc119f 100644
--- a/mcs/class/Facades/System.Diagnostics.TextWriterTraceListener/Makefile
+++ b/mcs/class/Facades/System.Diagnostics.TextWriterTraceListener/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.Diagnostics.TextWriterTraceListener.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Diagnostics.Tools/Makefile b/mcs/class/Facades/System.Diagnostics.Tools/Makefile
index 494f8b90da0..3d9b5158255 100644
--- a/mcs/class/Facades/System.Diagnostics.Tools/Makefile
+++ b/mcs/class/Facades/System.Diagnostics.Tools/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.Diagnostics.Tools.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Diagnostics.TraceEvent/Makefile b/mcs/class/Facades/System.Diagnostics.TraceEvent/Makefile
index a109b64df9a..342e82dbf4a 100644
--- a/mcs/class/Facades/System.Diagnostics.TraceEvent/Makefile
+++ b/mcs/class/Facades/System.Diagnostics.TraceEvent/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.Diagnostics.TraceEvent.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Diagnostics.TraceSource/Makefile b/mcs/class/Facades/System.Diagnostics.TraceSource/Makefile
index 2dbd5475cca..3467273f7c9 100644
--- a/mcs/class/Facades/System.Diagnostics.TraceSource/Makefile
+++ b/mcs/class/Facades/System.Diagnostics.TraceSource/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.Diagnostics.TraceSource.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Diagnostics.Tracing/Makefile b/mcs/class/Facades/System.Diagnostics.Tracing/Makefile
index 53a49cfff70..14b380da866 100644
--- a/mcs/class/Facades/System.Diagnostics.Tracing/Makefile
+++ b/mcs/class/Facades/System.Diagnostics.Tracing/Makefile
@@ -11,7 +11,7 @@ LIBRARY = System.Diagnostics.Tracing.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Dynamic.Runtime/Makefile b/mcs/class/Facades/System.Dynamic.Runtime/Makefile
index 9380c0ecba4..a6bcda9f3de 100644
--- a/mcs/class/Facades/System.Dynamic.Runtime/Makefile
+++ b/mcs/class/Facades/System.Dynamic.Runtime/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.Dynamic.Runtime.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System.Core System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Globalization.Calendars/Makefile b/mcs/class/Facades/System.Globalization.Calendars/Makefile
index 1659260c032..5f419e9b635 100644
--- a/mcs/class/Facades/System.Globalization.Calendars/Makefile
+++ b/mcs/class/Facades/System.Globalization.Calendars/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.Globalization.Calendars.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Globalization.Extensions/Makefile b/mcs/class/Facades/System.Globalization.Extensions/Makefile
index e4923237e7b..d3a57fa307d 100644
--- a/mcs/class/Facades/System.Globalization.Extensions/Makefile
+++ b/mcs/class/Facades/System.Globalization.Extensions/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.Globalization.Extensions.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Globalization/Makefile b/mcs/class/Facades/System.Globalization/Makefile
index e94f4b5561b..4f01dfeb762 100644
--- a/mcs/class/Facades/System.Globalization/Makefile
+++ b/mcs/class/Facades/System.Globalization/Makefile
@@ -11,7 +11,7 @@ LIBRARY = System.Globalization.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.IO.Compression.ZipFile/Makefile b/mcs/class/Facades/System.IO.Compression.ZipFile/Makefile
index 0865314a1bd..b4e4896a629 100644
--- a/mcs/class/Facades/System.IO.Compression.ZipFile/Makefile
+++ b/mcs/class/Facades/System.IO.Compression.ZipFile/Makefile
@@ -11,8 +11,8 @@ LIBRARY = System.IO.Compression.ZipFile.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll /r:System.IO.Compression.FileSystem.dll
+LIB_REFS = System System.IO.Compression.FileSystem
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.IO.FileSystem.AccessControl/Makefile b/mcs/class/Facades/System.IO.FileSystem.AccessControl/Makefile
index 6574fc62499..0198747a8a3 100644
--- a/mcs/class/Facades/System.IO.FileSystem.AccessControl/Makefile
+++ b/mcs/class/Facades/System.IO.FileSystem.AccessControl/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.IO.FileSystem.AccessControl.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.IO.FileSystem.DriveInfo/Makefile b/mcs/class/Facades/System.IO.FileSystem.DriveInfo/Makefile
index 096d6c7a7fa..0925c49d155 100644
--- a/mcs/class/Facades/System.IO.FileSystem.DriveInfo/Makefile
+++ b/mcs/class/Facades/System.IO.FileSystem.DriveInfo/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.IO.FileSystem.DriveInfo.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.IO.FileSystem.Primitives/Makefile b/mcs/class/Facades/System.IO.FileSystem.Primitives/Makefile
index 2622a088f2d..31b27077e45 100644
--- a/mcs/class/Facades/System.IO.FileSystem.Primitives/Makefile
+++ b/mcs/class/Facades/System.IO.FileSystem.Primitives/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.IO.FileSystem.Primitives.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.IO.FileSystem.Watcher/Makefile b/mcs/class/Facades/System.IO.FileSystem.Watcher/Makefile
index 2a4d25e1073..caade8a02a0 100644
--- a/mcs/class/Facades/System.IO.FileSystem.Watcher/Makefile
+++ b/mcs/class/Facades/System.IO.FileSystem.Watcher/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.IO.FileSystem.Watcher.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.IO.FileSystem/Makefile b/mcs/class/Facades/System.IO.FileSystem/Makefile
index cbd49ccc535..178aa60efea 100644
--- a/mcs/class/Facades/System.IO.FileSystem/Makefile
+++ b/mcs/class/Facades/System.IO.FileSystem/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.IO.FileSystem.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.IO.IsolatedStorage/Makefile b/mcs/class/Facades/System.IO.IsolatedStorage/Makefile
index e89d4be370b..be6a315004b 100644
--- a/mcs/class/Facades/System.IO.IsolatedStorage/Makefile
+++ b/mcs/class/Facades/System.IO.IsolatedStorage/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.IO.IsolatedStorage.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.IO.MemoryMappedFiles/Makefile b/mcs/class/Facades/System.IO.MemoryMappedFiles/Makefile
index 1ea56e44d94..656b03cd126 100644
--- a/mcs/class/Facades/System.IO.MemoryMappedFiles/Makefile
+++ b/mcs/class/Facades/System.IO.MemoryMappedFiles/Makefile
@@ -11,8 +11,8 @@ LIBRARY = System.IO.MemoryMappedFiles.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll /r:System.Core.dll
+LIB_REFS = System System.Core
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.IO.Pipes/Makefile b/mcs/class/Facades/System.IO.Pipes/Makefile
index 999b161afd3..0d156aafeb1 100644
--- a/mcs/class/Facades/System.IO.Pipes/Makefile
+++ b/mcs/class/Facades/System.IO.Pipes/Makefile
@@ -11,8 +11,8 @@ LIBRARY = System.IO.Pipes.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll /r:System.Core.dll
+LIB_REFS = System System.Core
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.IO.UnmanagedMemoryStream/Makefile b/mcs/class/Facades/System.IO.UnmanagedMemoryStream/Makefile
index c65888b2311..c1605d9ccf8 100644
--- a/mcs/class/Facades/System.IO.UnmanagedMemoryStream/Makefile
+++ b/mcs/class/Facades/System.IO.UnmanagedMemoryStream/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.IO.UnmanagedMemoryStream.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.IO/Makefile b/mcs/class/Facades/System.IO/Makefile
index 42a6a9413b4..89fc0db0963 100644
--- a/mcs/class/Facades/System.IO/Makefile
+++ b/mcs/class/Facades/System.IO/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.IO.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Linq.Expressions/Makefile b/mcs/class/Facades/System.Linq.Expressions/Makefile
index d2ad276ef09..bb78580fb43 100644
--- a/mcs/class/Facades/System.Linq.Expressions/Makefile
+++ b/mcs/class/Facades/System.Linq.Expressions/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.Linq.Expressions.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System.Core
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Linq.Parallel/Makefile b/mcs/class/Facades/System.Linq.Parallel/Makefile
index d68ebb41633..7d314bf5e95 100644
--- a/mcs/class/Facades/System.Linq.Parallel/Makefile
+++ b/mcs/class/Facades/System.Linq.Parallel/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.Linq.Parallel.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System.Core
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Linq.Queryable/Makefile b/mcs/class/Facades/System.Linq.Queryable/Makefile
index 1f0225e3aea..6ea4c746ec8 100644
--- a/mcs/class/Facades/System.Linq.Queryable/Makefile
+++ b/mcs/class/Facades/System.Linq.Queryable/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.Linq.Queryable.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System.Core
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Linq/Makefile b/mcs/class/Facades/System.Linq/Makefile
index 17bcabbdf83..d9778697d4c 100644
--- a/mcs/class/Facades/System.Linq/Makefile
+++ b/mcs/class/Facades/System.Linq/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.Linq.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System.Core
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Net.AuthenticationManager/Makefile b/mcs/class/Facades/System.Net.AuthenticationManager/Makefile
index 4efed6d1b28..293f80d25d3 100644
--- a/mcs/class/Facades/System.Net.AuthenticationManager/Makefile
+++ b/mcs/class/Facades/System.Net.AuthenticationManager/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.Net.AuthenticationManager.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Net.Cache/Makefile b/mcs/class/Facades/System.Net.Cache/Makefile
index 9826235d5b1..bbdcfce7592 100644
--- a/mcs/class/Facades/System.Net.Cache/Makefile
+++ b/mcs/class/Facades/System.Net.Cache/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.Net.Cache.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Net.Http.WebRequestHandler/Makefile b/mcs/class/Facades/System.Net.Http.WebRequestHandler/Makefile
index 202bfbe892a..7750bbae45a 100644
--- a/mcs/class/Facades/System.Net.Http.WebRequestHandler/Makefile
+++ b/mcs/class/Facades/System.Net.Http.WebRequestHandler/Makefile
@@ -11,8 +11,8 @@ LIBRARY = System.Net.Http.WebRequestHandler.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll /r:System.Net.Http.WebRequest.dll /r:System.Net.Http.dll
+LIB_REFS = System System.Net.Http.WebRequest System.Net.Http
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Net.HttpListener/Makefile b/mcs/class/Facades/System.Net.HttpListener/Makefile
index 401f473303c..3109e707615 100644
--- a/mcs/class/Facades/System.Net.HttpListener/Makefile
+++ b/mcs/class/Facades/System.Net.HttpListener/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.Net.HttpListener.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll /r:System.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Net.Mail/Makefile b/mcs/class/Facades/System.Net.Mail/Makefile
index 32aca2f9665..fe936b17d91 100644
--- a/mcs/class/Facades/System.Net.Mail/Makefile
+++ b/mcs/class/Facades/System.Net.Mail/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.Net.Mail.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll /r:System.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Net.NameResolution/Makefile b/mcs/class/Facades/System.Net.NameResolution/Makefile
index ae8b68c79d6..142a303c38e 100644
--- a/mcs/class/Facades/System.Net.NameResolution/Makefile
+++ b/mcs/class/Facades/System.Net.NameResolution/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.Net.NameResolution.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Net.NetworkInformation/Makefile b/mcs/class/Facades/System.Net.NetworkInformation/Makefile
index 29df735469a..bc2a7ec8166 100644
--- a/mcs/class/Facades/System.Net.NetworkInformation/Makefile
+++ b/mcs/class/Facades/System.Net.NetworkInformation/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.Net.NetworkInformation.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Net.Primitives/Makefile b/mcs/class/Facades/System.Net.Primitives/Makefile
index babbd33274b..bc362713259 100644
--- a/mcs/class/Facades/System.Net.Primitives/Makefile
+++ b/mcs/class/Facades/System.Net.Primitives/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.Net.Primitives.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Net.Requests/Makefile b/mcs/class/Facades/System.Net.Requests/Makefile
index 947ca929cef..7a8a231bc3b 100644
--- a/mcs/class/Facades/System.Net.Requests/Makefile
+++ b/mcs/class/Facades/System.Net.Requests/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.Net.Requests.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Net.Security/Makefile b/mcs/class/Facades/System.Net.Security/Makefile
index 4eab13bc8c8..cdd7db906c9 100644
--- a/mcs/class/Facades/System.Net.Security/Makefile
+++ b/mcs/class/Facades/System.Net.Security/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.Net.Security.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll /r:System.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Net.ServicePoint/Makefile b/mcs/class/Facades/System.Net.ServicePoint/Makefile
index bb8e7229f72..f0d095317dc 100644
--- a/mcs/class/Facades/System.Net.ServicePoint/Makefile
+++ b/mcs/class/Facades/System.Net.ServicePoint/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.Net.ServicePoint.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Net.Sockets/Makefile b/mcs/class/Facades/System.Net.Sockets/Makefile
index 0cd78a8dac0..bf60d5fef6b 100644
--- a/mcs/class/Facades/System.Net.Sockets/Makefile
+++ b/mcs/class/Facades/System.Net.Sockets/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.Net.Sockets.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll /r:System.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Net.Utilities/Makefile b/mcs/class/Facades/System.Net.Utilities/Makefile
index 77d83647a6d..6f1a5166b8a 100644
--- a/mcs/class/Facades/System.Net.Utilities/Makefile
+++ b/mcs/class/Facades/System.Net.Utilities/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.Net.Utilities.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Net.WebHeaderCollection/Makefile b/mcs/class/Facades/System.Net.WebHeaderCollection/Makefile
index b3fe02b3456..f6ec2a06526 100644
--- a/mcs/class/Facades/System.Net.WebHeaderCollection/Makefile
+++ b/mcs/class/Facades/System.Net.WebHeaderCollection/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.Net.WebHeaderCollection.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Net.WebSockets.Client/Makefile b/mcs/class/Facades/System.Net.WebSockets.Client/Makefile
index 8489220e960..2552b0e0d5b 100644
--- a/mcs/class/Facades/System.Net.WebSockets.Client/Makefile
+++ b/mcs/class/Facades/System.Net.WebSockets.Client/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.Net.WebSockets.Client.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Net.WebSockets/Makefile b/mcs/class/Facades/System.Net.WebSockets/Makefile
index 783ae541c93..e9fa98fd8b4 100644
--- a/mcs/class/Facades/System.Net.WebSockets/Makefile
+++ b/mcs/class/Facades/System.Net.WebSockets/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.Net.WebSockets.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.ObjectModel/Makefile b/mcs/class/Facades/System.ObjectModel/Makefile
index 56ca84ae0da..0838b23d3cf 100644
--- a/mcs/class/Facades/System.ObjectModel/Makefile
+++ b/mcs/class/Facades/System.ObjectModel/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.ObjectModel.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Private.CoreLib.InteropServices/Makefile b/mcs/class/Facades/System.Private.CoreLib.InteropServices/Makefile
index ee55fc62375..7b03ca8fdb0 100644
--- a/mcs/class/Facades/System.Private.CoreLib.InteropServices/Makefile
+++ b/mcs/class/Facades/System.Private.CoreLib.InteropServices/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.Private.CoreLib.InteropServices.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Private.CoreLib.Threading/Makefile b/mcs/class/Facades/System.Private.CoreLib.Threading/Makefile
index 52ce0e308ad..347b171983e 100644
--- a/mcs/class/Facades/System.Private.CoreLib.Threading/Makefile
+++ b/mcs/class/Facades/System.Private.CoreLib.Threading/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.Private.CoreLib.Threading.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Reflection.Emit.ILGeneration/Makefile b/mcs/class/Facades/System.Reflection.Emit.ILGeneration/Makefile
index f9c54c54b2f..6ee536f7b71 100644
--- a/mcs/class/Facades/System.Reflection.Emit.ILGeneration/Makefile
+++ b/mcs/class/Facades/System.Reflection.Emit.ILGeneration/Makefile
@@ -11,7 +11,7 @@ LIBRARY = System.Reflection.Emit.ILGeneration.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Reflection.Emit.Lightweight/Makefile b/mcs/class/Facades/System.Reflection.Emit.Lightweight/Makefile
index 70a46b888d5..93292276ab1 100644
--- a/mcs/class/Facades/System.Reflection.Emit.Lightweight/Makefile
+++ b/mcs/class/Facades/System.Reflection.Emit.Lightweight/Makefile
@@ -11,7 +11,7 @@ LIBRARY = System.Reflection.Emit.Lightweight.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Reflection.Emit/Makefile b/mcs/class/Facades/System.Reflection.Emit/Makefile
index 2227a3ca80f..798d457271e 100644
--- a/mcs/class/Facades/System.Reflection.Emit/Makefile
+++ b/mcs/class/Facades/System.Reflection.Emit/Makefile
@@ -11,7 +11,7 @@ LIBRARY = System.Reflection.Emit.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Reflection.Extensions/Makefile b/mcs/class/Facades/System.Reflection.Extensions/Makefile
index db7f3df173d..e1799cc150e 100644
--- a/mcs/class/Facades/System.Reflection.Extensions/Makefile
+++ b/mcs/class/Facades/System.Reflection.Extensions/Makefile
@@ -11,7 +11,7 @@ LIBRARY = System.Reflection.Extensions.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Reflection.Primitives/Makefile b/mcs/class/Facades/System.Reflection.Primitives/Makefile
index 99a3a39505d..ee500e52ecb 100644
--- a/mcs/class/Facades/System.Reflection.Primitives/Makefile
+++ b/mcs/class/Facades/System.Reflection.Primitives/Makefile
@@ -11,7 +11,7 @@ LIBRARY = System.Reflection.Primitives.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Reflection.TypeExtensions/Makefile b/mcs/class/Facades/System.Reflection.TypeExtensions/Makefile
index 3e4d713ac53..b2bb49ecfd1 100644
--- a/mcs/class/Facades/System.Reflection.TypeExtensions/Makefile
+++ b/mcs/class/Facades/System.Reflection.TypeExtensions/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.Reflection.TypeExtensions.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Reflection/Makefile b/mcs/class/Facades/System.Reflection/Makefile
index 862b9333ccc..3061a268a23 100644
--- a/mcs/class/Facades/System.Reflection/Makefile
+++ b/mcs/class/Facades/System.Reflection/Makefile
@@ -11,7 +11,7 @@ LIBRARY = System.Reflection.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Resources.ReaderWriter/Makefile b/mcs/class/Facades/System.Resources.ReaderWriter/Makefile
index 48c56ade5a3..e2795e40f7d 100644
--- a/mcs/class/Facades/System.Resources.ReaderWriter/Makefile
+++ b/mcs/class/Facades/System.Resources.ReaderWriter/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.Resources.ReaderWriter.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Resources.ResourceManager/Makefile b/mcs/class/Facades/System.Resources.ResourceManager/Makefile
index 72e539364cf..15f241e4091 100644
--- a/mcs/class/Facades/System.Resources.ResourceManager/Makefile
+++ b/mcs/class/Facades/System.Resources.ResourceManager/Makefile
@@ -11,7 +11,7 @@ LIBRARY = System.Resources.ResourceManager.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Runtime.CompilerServices.VisualC/Makefile b/mcs/class/Facades/System.Runtime.CompilerServices.VisualC/Makefile
index 21d3f78844e..6f7f15c612e 100644
--- a/mcs/class/Facades/System.Runtime.CompilerServices.VisualC/Makefile
+++ b/mcs/class/Facades/System.Runtime.CompilerServices.VisualC/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.Runtime.CompilerServices.VisualC.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Runtime.Extensions/Makefile b/mcs/class/Facades/System.Runtime.Extensions/Makefile
index 981cb5f8233..70fd8c93305 100644
--- a/mcs/class/Facades/System.Runtime.Extensions/Makefile
+++ b/mcs/class/Facades/System.Runtime.Extensions/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.Runtime.Extensions.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Runtime.Handles/Makefile b/mcs/class/Facades/System.Runtime.Handles/Makefile
index 396738e44e5..db800c29abf 100644
--- a/mcs/class/Facades/System.Runtime.Handles/Makefile
+++ b/mcs/class/Facades/System.Runtime.Handles/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.Runtime.Handles.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System System.Core
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Runtime.InteropServices.WindowsRuntime/Makefile b/mcs/class/Facades/System.Runtime.InteropServices.WindowsRuntime/Makefile
index a6340fb3e76..1aaf02e2fc5 100644
--- a/mcs/class/Facades/System.Runtime.InteropServices.WindowsRuntime/Makefile
+++ b/mcs/class/Facades/System.Runtime.InteropServices.WindowsRuntime/Makefile
@@ -11,7 +11,7 @@ LIBRARY = System.Runtime.InteropServices.WindowsRuntime.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Runtime.InteropServices/Makefile b/mcs/class/Facades/System.Runtime.InteropServices/Makefile
index 51ef698b24c..dd20654dcd3 100644
--- a/mcs/class/Facades/System.Runtime.InteropServices/Makefile
+++ b/mcs/class/Facades/System.Runtime.InteropServices/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.Runtime.InteropServices.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System System.Core
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Runtime.Numerics/Makefile b/mcs/class/Facades/System.Runtime.Numerics/Makefile
index e452fc5aca5..57867bb26a1 100644
--- a/mcs/class/Facades/System.Runtime.Numerics/Makefile
+++ b/mcs/class/Facades/System.Runtime.Numerics/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.Runtime.Numerics.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System.Numerics
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Runtime.Serialization.Json/Makefile b/mcs/class/Facades/System.Runtime.Serialization.Json/Makefile
index 304059eaabb..b5ca5ce40b2 100644
--- a/mcs/class/Facades/System.Runtime.Serialization.Json/Makefile
+++ b/mcs/class/Facades/System.Runtime.Serialization.Json/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.Runtime.Serialization.Json.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System.Runtime.Serialization
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Runtime.Serialization.Primitives/Makefile b/mcs/class/Facades/System.Runtime.Serialization.Primitives/Makefile
index 648884fc9b7..3a2519549fc 100644
--- a/mcs/class/Facades/System.Runtime.Serialization.Primitives/Makefile
+++ b/mcs/class/Facades/System.Runtime.Serialization.Primitives/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.Runtime.Serialization.Primitives.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System.Runtime.Serialization
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Runtime.Serialization.Xml/Makefile b/mcs/class/Facades/System.Runtime.Serialization.Xml/Makefile
index cc0aec4a369..774289eb4de 100644
--- a/mcs/class/Facades/System.Runtime.Serialization.Xml/Makefile
+++ b/mcs/class/Facades/System.Runtime.Serialization.Xml/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.Runtime.Serialization.Xml.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System.Runtime.Serialization System.Xml
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Runtime/Makefile b/mcs/class/Facades/System.Runtime/Makefile
index c59de138408..e8ab4049a26 100644
--- a/mcs/class/Facades/System.Runtime/Makefile
+++ b/mcs/class/Facades/System.Runtime/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.Runtime.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System System.ComponentModel.Composition System.Core
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Security.AccessControl/Makefile b/mcs/class/Facades/System.Security.AccessControl/Makefile
index 3491238f861..5c6ad1c09ec 100644
--- a/mcs/class/Facades/System.Security.AccessControl/Makefile
+++ b/mcs/class/Facades/System.Security.AccessControl/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.Security.AccessControl.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Security.Claims/Makefile b/mcs/class/Facades/System.Security.Claims/Makefile
index 72b761e38a5..36ff76137ba 100644
--- a/mcs/class/Facades/System.Security.Claims/Makefile
+++ b/mcs/class/Facades/System.Security.Claims/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.Security.Claims.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Security.Cryptography.DeriveBytes/Makefile b/mcs/class/Facades/System.Security.Cryptography.DeriveBytes/Makefile
index 1beaa35e013..4988d34843d 100644
--- a/mcs/class/Facades/System.Security.Cryptography.DeriveBytes/Makefile
+++ b/mcs/class/Facades/System.Security.Cryptography.DeriveBytes/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.Security.Cryptography.DeriveBytes.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Security.Cryptography.Encoding/Makefile b/mcs/class/Facades/System.Security.Cryptography.Encoding/Makefile
index 5bf1ccf0ab3..71d37e200e0 100644
--- a/mcs/class/Facades/System.Security.Cryptography.Encoding/Makefile
+++ b/mcs/class/Facades/System.Security.Cryptography.Encoding/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.Security.Cryptography.Encoding.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Security.Cryptography.Encryption.Aes/Makefile b/mcs/class/Facades/System.Security.Cryptography.Encryption.Aes/Makefile
index b43610b6764..0598a53f1d4 100644
--- a/mcs/class/Facades/System.Security.Cryptography.Encryption.Aes/Makefile
+++ b/mcs/class/Facades/System.Security.Cryptography.Encryption.Aes/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.Security.Cryptography.Encryption.Aes.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Security.Cryptography.Encryption.ECDiffieHellman/Makefile b/mcs/class/Facades/System.Security.Cryptography.Encryption.ECDiffieHellman/Makefile
index a2c373ac08a..03e69f1f95a 100644
--- a/mcs/class/Facades/System.Security.Cryptography.Encryption.ECDiffieHellman/Makefile
+++ b/mcs/class/Facades/System.Security.Cryptography.Encryption.ECDiffieHellman/Makefile
@@ -11,8 +11,8 @@ LIBRARY = System.Security.Cryptography.Encryption.ECDiffieHellman.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll /r:System.Core.dll
+LIB_REFS = System System.Core
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Security.Cryptography.Encryption.ECDsa/Makefile b/mcs/class/Facades/System.Security.Cryptography.Encryption.ECDsa/Makefile
index 2bae1ac269d..08e99941082 100644
--- a/mcs/class/Facades/System.Security.Cryptography.Encryption.ECDsa/Makefile
+++ b/mcs/class/Facades/System.Security.Cryptography.Encryption.ECDsa/Makefile
@@ -11,8 +11,8 @@ LIBRARY = System.Security.Cryptography.Encryption.ECDsa.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll /r:System.Core.dll
+LIB_REFS = System System.Core
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Security.Cryptography.Encryption/Makefile b/mcs/class/Facades/System.Security.Cryptography.Encryption/Makefile
index 26d1d81df80..0e8b1644280 100644
--- a/mcs/class/Facades/System.Security.Cryptography.Encryption/Makefile
+++ b/mcs/class/Facades/System.Security.Cryptography.Encryption/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.Security.Cryptography.Encryption.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Security.Cryptography.Hashing.Algorithms/Makefile b/mcs/class/Facades/System.Security.Cryptography.Hashing.Algorithms/Makefile
index e146e689b97..45dad5331da 100644
--- a/mcs/class/Facades/System.Security.Cryptography.Hashing.Algorithms/Makefile
+++ b/mcs/class/Facades/System.Security.Cryptography.Hashing.Algorithms/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.Security.Cryptography.Hashing.Algorithms.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Security.Cryptography.Hashing/Makefile b/mcs/class/Facades/System.Security.Cryptography.Hashing/Makefile
index 450bb596fd8..9df5800609b 100644
--- a/mcs/class/Facades/System.Security.Cryptography.Hashing/Makefile
+++ b/mcs/class/Facades/System.Security.Cryptography.Hashing/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.Security.Cryptography.Hashing.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Security.Cryptography.ProtectedData/Makefile b/mcs/class/Facades/System.Security.Cryptography.ProtectedData/Makefile
index f82c8604162..1cdbf1de8f3 100644
--- a/mcs/class/Facades/System.Security.Cryptography.ProtectedData/Makefile
+++ b/mcs/class/Facades/System.Security.Cryptography.ProtectedData/Makefile
@@ -11,8 +11,8 @@ LIBRARY = System.Security.Cryptography.ProtectedData.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll /r:System.Security.dll
+LIB_REFS = System System.Security
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Security.Cryptography.RSA/Makefile b/mcs/class/Facades/System.Security.Cryptography.RSA/Makefile
index a88e14ef6cc..ea7df7a042a 100644
--- a/mcs/class/Facades/System.Security.Cryptography.RSA/Makefile
+++ b/mcs/class/Facades/System.Security.Cryptography.RSA/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.Security.Cryptography.RSA.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Security.Cryptography.RandomNumberGenerator/Makefile b/mcs/class/Facades/System.Security.Cryptography.RandomNumberGenerator/Makefile
index d9fdec015a2..2ffcdbc236f 100644
--- a/mcs/class/Facades/System.Security.Cryptography.RandomNumberGenerator/Makefile
+++ b/mcs/class/Facades/System.Security.Cryptography.RandomNumberGenerator/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.Security.Cryptography.RandomNumberGenerator.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Security.Cryptography.X509Certificates/Makefile b/mcs/class/Facades/System.Security.Cryptography.X509Certificates/Makefile
index 911aa9fd268..5ad2d813f95 100644
--- a/mcs/class/Facades/System.Security.Cryptography.X509Certificates/Makefile
+++ b/mcs/class/Facades/System.Security.Cryptography.X509Certificates/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.Security.Cryptography.X509Certificates.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Security.Principal.Windows/Makefile b/mcs/class/Facades/System.Security.Principal.Windows/Makefile
index 8284f5fd5ba..a287f05cb84 100644
--- a/mcs/class/Facades/System.Security.Principal.Windows/Makefile
+++ b/mcs/class/Facades/System.Security.Principal.Windows/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.Security.Principal.Windows.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Security.Principal/Makefile b/mcs/class/Facades/System.Security.Principal/Makefile
index c4db6800149..1a1265a0e05 100644
--- a/mcs/class/Facades/System.Security.Principal/Makefile
+++ b/mcs/class/Facades/System.Security.Principal/Makefile
@@ -11,7 +11,7 @@ LIBRARY = System.Security.Principal.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Security.SecureString/Makefile b/mcs/class/Facades/System.Security.SecureString/Makefile
index fb949fbe07e..b33d20dc202 100644
--- a/mcs/class/Facades/System.Security.SecureString/Makefile
+++ b/mcs/class/Facades/System.Security.SecureString/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.Security.SecureString.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.ServiceModel.Duplex/Makefile b/mcs/class/Facades/System.ServiceModel.Duplex/Makefile
index 90f55a71d5e..a8f568f78b5 100644
--- a/mcs/class/Facades/System.ServiceModel.Duplex/Makefile
+++ b/mcs/class/Facades/System.ServiceModel.Duplex/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.ServiceModel.Duplex.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System.ServiceModel
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.ServiceModel.Http/Makefile b/mcs/class/Facades/System.ServiceModel.Http/Makefile
index 99587810c49..05f7925c2c6 100644
--- a/mcs/class/Facades/System.ServiceModel.Http/Makefile
+++ b/mcs/class/Facades/System.ServiceModel.Http/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.ServiceModel.Http.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System.ServiceModel
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.ServiceModel.NetTcp/Makefile b/mcs/class/Facades/System.ServiceModel.NetTcp/Makefile
index c01e4819efb..f0af8c7dc60 100644
--- a/mcs/class/Facades/System.ServiceModel.NetTcp/Makefile
+++ b/mcs/class/Facades/System.ServiceModel.NetTcp/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.ServiceModel.NetTcp.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System.ServiceModel
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.ServiceModel.Primitives/Makefile b/mcs/class/Facades/System.ServiceModel.Primitives/Makefile
index 6f94ff346f8..5f65e0599a3 100644
--- a/mcs/class/Facades/System.ServiceModel.Primitives/Makefile
+++ b/mcs/class/Facades/System.ServiceModel.Primitives/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.ServiceModel.Primitives.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System.ServiceModel System.Xml
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.ServiceModel.Security/Makefile b/mcs/class/Facades/System.ServiceModel.Security/Makefile
index 4e572464aa8..f68beafd26e 100644
--- a/mcs/class/Facades/System.ServiceModel.Security/Makefile
+++ b/mcs/class/Facades/System.ServiceModel.Security/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.ServiceModel.Security.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System.ServiceModel
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.ServiceProcess.ServiceController/Makefile b/mcs/class/Facades/System.ServiceProcess.ServiceController/Makefile
index 9025a6cd91d..2724a34a105 100644
--- a/mcs/class/Facades/System.ServiceProcess.ServiceController/Makefile
+++ b/mcs/class/Facades/System.ServiceProcess.ServiceController/Makefile
@@ -11,8 +11,8 @@ LIBRARY = System.ServiceProcess.ServiceController.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll /r:System.ServiceProcess.dll
+LIB_REFS = System System.ServiceProcess
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Text.Encoding.Extensions/Makefile b/mcs/class/Facades/System.Text.Encoding.Extensions/Makefile
index 114132e3a0f..e851968fdb4 100644
--- a/mcs/class/Facades/System.Text.Encoding.Extensions/Makefile
+++ b/mcs/class/Facades/System.Text.Encoding.Extensions/Makefile
@@ -11,7 +11,7 @@ LIBRARY = System.Text.Encoding.Extensions.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Text.Encoding/Makefile b/mcs/class/Facades/System.Text.Encoding/Makefile
index aeb003f7bb8..fdfff718497 100644
--- a/mcs/class/Facades/System.Text.Encoding/Makefile
+++ b/mcs/class/Facades/System.Text.Encoding/Makefile
@@ -11,7 +11,7 @@ LIBRARY = System.Text.Encoding.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Text.RegularExpressions/Makefile b/mcs/class/Facades/System.Text.RegularExpressions/Makefile
index 423212c687c..b345b0d5dcd 100644
--- a/mcs/class/Facades/System.Text.RegularExpressions/Makefile
+++ b/mcs/class/Facades/System.Text.RegularExpressions/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.Text.RegularExpressions.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Threading.AccessControl/Makefile b/mcs/class/Facades/System.Threading.AccessControl/Makefile
index 56cf986675d..b0c9264a03b 100644
--- a/mcs/class/Facades/System.Threading.AccessControl/Makefile
+++ b/mcs/class/Facades/System.Threading.AccessControl/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.Threading.AccessControl.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Threading.Overlapped/Makefile b/mcs/class/Facades/System.Threading.Overlapped/Makefile
index 29dbfe5e191..460fb4aff26 100644
--- a/mcs/class/Facades/System.Threading.Overlapped/Makefile
+++ b/mcs/class/Facades/System.Threading.Overlapped/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.Threading.Overlapped.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Threading.Tasks.Parallel/Makefile b/mcs/class/Facades/System.Threading.Tasks.Parallel/Makefile
index 1f74d4934d3..7e350f61c2a 100644
--- a/mcs/class/Facades/System.Threading.Tasks.Parallel/Makefile
+++ b/mcs/class/Facades/System.Threading.Tasks.Parallel/Makefile
@@ -11,7 +11,7 @@ LIBRARY = System.Threading.Tasks.Parallel.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Threading.Tasks/Makefile b/mcs/class/Facades/System.Threading.Tasks/Makefile
index c89db2377a8..deea2c66a8a 100644
--- a/mcs/class/Facades/System.Threading.Tasks/Makefile
+++ b/mcs/class/Facades/System.Threading.Tasks/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.Threading.Tasks.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System.Core
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Threading.Thread/Makefile b/mcs/class/Facades/System.Threading.Thread/Makefile
index 177e8890f9f..cc0bb96aa06 100644
--- a/mcs/class/Facades/System.Threading.Thread/Makefile
+++ b/mcs/class/Facades/System.Threading.Thread/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.Threading.Thread.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Threading.ThreadPool/Makefile b/mcs/class/Facades/System.Threading.ThreadPool/Makefile
index 67b0082be9e..604a88c87e7 100644
--- a/mcs/class/Facades/System.Threading.ThreadPool/Makefile
+++ b/mcs/class/Facades/System.Threading.ThreadPool/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.Threading.ThreadPool.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Threading.Timer/Makefile b/mcs/class/Facades/System.Threading.Timer/Makefile
index 35df02e1825..5ab3f840901 100644
--- a/mcs/class/Facades/System.Threading.Timer/Makefile
+++ b/mcs/class/Facades/System.Threading.Timer/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.Threading.Timer.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System System.Core
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Threading/Makefile b/mcs/class/Facades/System.Threading/Makefile
index 1982ff8384e..b6b5c4cd67b 100644
--- a/mcs/class/Facades/System.Threading/Makefile
+++ b/mcs/class/Facades/System.Threading/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.Threading.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System System.Core
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Xml.ReaderWriter/Makefile b/mcs/class/Facades/System.Xml.ReaderWriter/Makefile
index 373c1ff882e..27f820f582e 100644
--- a/mcs/class/Facades/System.Xml.ReaderWriter/Makefile
+++ b/mcs/class/Facades/System.Xml.ReaderWriter/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.Xml.ReaderWriter.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System.Xml
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Xml.XDocument/Makefile b/mcs/class/Facades/System.Xml.XDocument/Makefile
index e55fec5512e..79eaaf44249 100644
--- a/mcs/class/Facades/System.Xml.XDocument/Makefile
+++ b/mcs/class/Facades/System.Xml.XDocument/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.Xml.XDocument.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System.Xml.Linq System.Xml
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Xml.XPath.XDocument/Makefile b/mcs/class/Facades/System.Xml.XPath.XDocument/Makefile
index ee05487967b..45ffe3482e0 100644
--- a/mcs/class/Facades/System.Xml.XPath.XDocument/Makefile
+++ b/mcs/class/Facades/System.Xml.XPath.XDocument/Makefile
@@ -11,8 +11,8 @@ LIBRARY = System.Xml.XPath.XDocument.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll /r:System.Xml.Linq.dll
+LIB_REFS = System System.Xml.Linq
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Xml.XPath/Makefile b/mcs/class/Facades/System.Xml.XPath/Makefile
index 86a093ba7ad..7a7ebf6de9d 100644
--- a/mcs/class/Facades/System.Xml.XPath/Makefile
+++ b/mcs/class/Facades/System.Xml.XPath/Makefile
@@ -11,8 +11,8 @@ LIBRARY = System.Xml.XPath.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll /r:System.Xml.dll
+LIB_REFS = System System.Xml
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Xml.XmlDocument/Makefile b/mcs/class/Facades/System.Xml.XmlDocument/Makefile
index 68224f9f25f..8628579f2f1 100644
--- a/mcs/class/Facades/System.Xml.XmlDocument/Makefile
+++ b/mcs/class/Facades/System.Xml.XmlDocument/Makefile
@@ -11,8 +11,8 @@ LIBRARY = System.Xml.XmlDocument.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll /r:System.Xml.dll
+LIB_REFS = System System.Xml
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Xml.XmlSerializer/Makefile b/mcs/class/Facades/System.Xml.XmlSerializer/Makefile
index 3a1e1396f75..f8c09af8c35 100644
--- a/mcs/class/Facades/System.Xml.XmlSerializer/Makefile
+++ b/mcs/class/Facades/System.Xml.XmlSerializer/Makefile
@@ -12,7 +12,7 @@ LIBRARY = System.Xml.XmlSerializer.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System.Xml
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/Facades/System.Xml.Xsl.Primitives/Makefile b/mcs/class/Facades/System.Xml.Xsl.Primitives/Makefile
index d038a8d5840..abddd14886e 100644
--- a/mcs/class/Facades/System.Xml.Xsl.Primitives/Makefile
+++ b/mcs/class/Facades/System.Xml.Xsl.Primitives/Makefile
@@ -11,8 +11,8 @@ LIBRARY = System.Xml.Xsl.Primitives.dll
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib.dll /r:System.Xml.dll
+LIB_REFS = System System.Xml
+LIB_MCS_FLAGS = $(SIGN_FLAGS)
PLATFORM_DEBUG_FLAGS =
diff --git a/mcs/class/I18N/CJK/Makefile b/mcs/class/I18N/CJK/Makefile
index 9d6c885099c..e5b85c14f00 100644
--- a/mcs/class/I18N/CJK/Makefile
+++ b/mcs/class/I18N/CJK/Makefile
@@ -3,7 +3,9 @@ SUBDIRS =
include ../../../build/rules.make
LIBRARY = I18N.CJK.dll
-LOCAL_MCS_FLAGS = /unsafe /resource:big5.table /resource:gb2312.table /resource:jis.table /resource:ks.table /resource:gb18030.table /r:$(corlib) /r:I18N.dll /define:DISABLE_UNSAFE
+LIB_REFS = I18N
+LOCAL_MCS_FLAGS = /unsafe /resource:big5.table /resource:gb2312.table /resource:jis.table /resource:ks.table /resource:gb18030.table /define:DISABLE_UNSAFE
+TEST_LIB_REFS = I18N
EXTRA_DISTFILES = big5.table jis.table gb2312.table ks.table gb18030.table \
README.gb18030 \
diff --git a/mcs/class/I18N/Common/Makefile b/mcs/class/I18N/Common/Makefile
index af1aa401cd5..b68973bdc26 100644
--- a/mcs/class/I18N/Common/Makefile
+++ b/mcs/class/I18N/Common/Makefile
@@ -3,7 +3,7 @@ SUBDIRS =
include ../../../build/rules.make
LIBRARY = I18N.dll
-LOCAL_MCS_FLAGS = /r:$(corlib) /unsafe /define:DISABLE_UNSAFE
+LOCAL_MCS_FLAGS = /unsafe /define:DISABLE_UNSAFE
NO_TEST = yes
include ../../../build/library.make
diff --git a/mcs/class/I18N/MidEast/Makefile b/mcs/class/I18N/MidEast/Makefile
index aafe245f6a4..1872c831e58 100644
--- a/mcs/class/I18N/MidEast/Makefile
+++ b/mcs/class/I18N/MidEast/Makefile
@@ -3,8 +3,9 @@ SUBDIRS =
include ../../../build/rules.make
LIBRARY = I18N.MidEast.dll
-LOCAL_MCS_FLAGS = /r:$(corlib) /r:I18N.dll /unsafe
-#NO_TEST = yes
+LIB_REFS = I18N
+LOCAL_MCS_FLAGS = /unsafe
+TEST_LIB_REFS = I18N
EXTRA_DISTFILES = $(wildcard *.ucm) \
$(wildcard Test/texts/*.txt)
diff --git a/mcs/class/I18N/Other/Makefile b/mcs/class/I18N/Other/Makefile
index e5740f32cb6..47fac195ad9 100644
--- a/mcs/class/I18N/Other/Makefile
+++ b/mcs/class/I18N/Other/Makefile
@@ -3,7 +3,8 @@ SUBDIRS =
include ../../../build/rules.make
LIBRARY = I18N.Other.dll
-LOCAL_MCS_FLAGS = /r:$(corlib) /r:I18N.dll /unsafe
+LIB_REFS = I18N
+LOCAL_MCS_FLAGS = /unsafe
NO_TEST = yes
EXTRA_DISTFILES = $(wildcard *.ucm)
diff --git a/mcs/class/I18N/Rare/Makefile b/mcs/class/I18N/Rare/Makefile
index fd315cfce14..f558e20e555 100644
--- a/mcs/class/I18N/Rare/Makefile
+++ b/mcs/class/I18N/Rare/Makefile
@@ -3,7 +3,8 @@ SUBDIRS =
include ../../../build/rules.make
LIBRARY = I18N.Rare.dll
-LOCAL_MCS_FLAGS = /r:$(corlib) /r:I18N.dll /unsafe
+LIB_REFS = I18N
+LOCAL_MCS_FLAGS = /unsafe
NO_TEST = yes
EXTRA_DISTFILES = $(wildcard *.ucm)
diff --git a/mcs/class/I18N/West/Makefile b/mcs/class/I18N/West/Makefile
index e8b7afe3d07..bc4b2386188 100644
--- a/mcs/class/I18N/West/Makefile
+++ b/mcs/class/I18N/West/Makefile
@@ -3,7 +3,8 @@ SUBDIRS =
include ../../../build/rules.make
LIBRARY = I18N.West.dll
-LOCAL_MCS_FLAGS = /r:$(corlib) /r:I18N.dll /unsafe
+LIB_REFS = I18N
+LOCAL_MCS_FLAGS = /unsafe
#NO_TEST = yes
EXTRA_DISTFILES = $(wildcard *.ucm) \
diff --git a/mcs/class/IBM.Data.DB2/Makefile b/mcs/class/IBM.Data.DB2/Makefile
index 732087d903e..630df027785 100644
--- a/mcs/class/IBM.Data.DB2/Makefile
+++ b/mcs/class/IBM.Data.DB2/Makefile
@@ -4,7 +4,7 @@ include ../../build/rules.make
LIBRARY = IBM.Data.DB2.dll
LIB_REFS = System System.Xml System.Data
-LIB_MCS_FLAGS = /unsafe /r:$(corlib) -warn:1
+LIB_MCS_FLAGS = /unsafe -warn:1
NO_TEST = yes
EXTRA_DISTFILES = ibm.pub
diff --git a/mcs/class/ICSharpCode.SharpZipLib/Makefile b/mcs/class/ICSharpCode.SharpZipLib/Makefile
index 6a4052c5577..bd64d2a4d66 100644
--- a/mcs/class/ICSharpCode.SharpZipLib/Makefile
+++ b/mcs/class/ICSharpCode.SharpZipLib/Makefile
@@ -6,7 +6,7 @@ LIBRARY = ICSharpCode.SharpZipLib.dll
LIBRARY_SNK = SharpZipLib.key
LIB_REFS = System System.Xml
-LIB_MCS_FLAGS = /r:$(corlib) -warn:1
+LIB_MCS_FLAGS = -warn:1
NO_TEST = yes
EXTRA_DISTFILES = SharpZipLib.pub $(LIBRARY_SNK)
diff --git a/mcs/class/Microsoft.Build.Engine/Makefile b/mcs/class/Microsoft.Build.Engine/Makefile
index 47216dc7d24..7cd5d287a62 100644
--- a/mcs/class/Microsoft.Build.Engine/Makefile
+++ b/mcs/class/Microsoft.Build.Engine/Makefile
@@ -7,19 +7,11 @@ include $(XBUILD_DIR)/xbuild.make
LIBRARY = Microsoft.Build.Engine.dll
-LIB_REFS = System System.Core System.Xml
-LIB_MCS_FLAGS = \
- /r:$(corlib) \
- /r:System.dll \
- /r:System.Core.dll \
- /r:System.Xml.dll \
- /r:$(XBUILD_FRAMEWORK) \
- /r:$(XBUILD_UTILITIES)
-
-TEST_MCS_FLAGS = \
- /r:$(XBUILD_FRAMEWORK) \
- /r:$(XBUILD_UTILITIES) \
- /r:System.Xml.dll
+LIB_REFS = $(PARENT_PROFILE)System $(PARENT_PROFILE)System.Core $(PARENT_PROFILE)System.Xml $(XBUILD_FRAMEWORK) $(XBUILD_UTILITIES)
+LIB_MCS_FLAGS =
+
+TEST_MCS_FLAGS =
+TEST_LIB_REFS = $(XBUILD_FRAMEWORK) $(XBUILD_UTILITIES) $(PARENT_PROFILE)System.Xml
EXTRA_DISTFILES = \
Test/resources/TestTasks.cs \
@@ -27,16 +19,16 @@ EXTRA_DISTFILES = \
Test/resources/*.csproj
Test/resources/TestTasks-$(PROFILE).dll: Test/resources/TestTasks.cs
- $(CSCOMPILE) /out:$@ Test/resources/TestTasks.cs /r:$(XBUILD_FRAMEWORK) /r:$(XBUILD_UTILITIES) /target:library
+ $(CSCOMPILE) /out:$@ Test/resources/TestTasks.cs /r:$(topdir)/class/lib/$(PROFILE)/$(XBUILD_FRAMEWORK).dll /r:$(topdir)/class/lib/$(PROFILE)/$(XBUILD_UTILITIES).dll /target:library
clean-test-resources:
- rm -f Test/resources/TestTasks*.dll Test/resources/TestTasks*.dll.mdb
+ rm -f Test/resources/TestTasks*.dll Test/resources/TestTasks*.pdb
test-local: compile-resources
compile-resources: Test/resources/TestTasks-$(PROFILE).dll
cp Test/resources/TestTasks-$(PROFILE).dll Test/resources/TestTasks.dll
- cp Test/resources/TestTasks-$(PROFILE).dll.mdb Test/resources/TestTasks.dll.mdb
+ cp Test/resources/TestTasks-$(PROFILE).pdb Test/resources/TestTasks.pdb
clean-local: clean-test-resources
diff --git a/mcs/class/Microsoft.Build.Framework/Makefile b/mcs/class/Microsoft.Build.Framework/Makefile
index 779dc9e2fd4..f31f5a5835e 100644
--- a/mcs/class/Microsoft.Build.Framework/Makefile
+++ b/mcs/class/Microsoft.Build.Framework/Makefile
@@ -7,10 +7,8 @@ include $(XBUILD_DIR)/xbuild.make
LIBRARY = Microsoft.Build.Framework.dll
-LIB_REFS = System
-LIB_MCS_FLAGS = \
- /r:$(corlib) \
- /r:System.dll
+LIB_REFS = $(PARENT_PROFILE)System
+LIB_MCS_FLAGS =
EXTRA_DISTFILES = \
Mono.XBuild.Framework/AssemblyLoadInfo.cs
diff --git a/mcs/class/Microsoft.Build.Tasks/Makefile b/mcs/class/Microsoft.Build.Tasks/Makefile
index 66b74a84728..d451c754e74 100644
--- a/mcs/class/Microsoft.Build.Tasks/Makefile
+++ b/mcs/class/Microsoft.Build.Tasks/Makefile
@@ -9,28 +9,14 @@ LIBRARY = Microsoft.Build.Tasks.dll
LIBRARY_NAME = Microsoft.Build.Tasks$(NAME_SUFFIX).dll
-LIB_REFS = System System.Core System.Xml System.Windows.Forms
-LIB_MCS_FLAGS = \
- /r:$(corlib) \
- /r:System.dll \
- /r:System.Core.dll \
- /r:System.Xml.dll \
- /r:System.Windows.Forms.dll \
- /r:$(XBUILD_UTILITIES) \
- /r:$(XBUILD_FRAMEWORK) \
- /r:$(XBUILD_ENGINE) \
- /r:$(XBUILD_TASKS)
-
-TEST_MCS_FLAGS = \
- /r:System.Xml.dll \
- /r:$(XBUILD_ENGINE) \
- /r:$(XBUILD_FRAMEWORK) \
- /r:$(XBUILD_TASKS) \
- /r:$(XBUILD_UTILITIES) \
- /r:System.Core.dll
+LIB_REFS = $(PARENT_PROFILE)System $(PARENT_PROFILE)System.Core $(PARENT_PROFILE)System.Xml $(PARENT_PROFILE)System.Windows.Forms \
+ $(XBUILD_UTILITIES) $(XBUILD_FRAMEWORK) $(XBUILD_ENGINE) $(XBUILD_TASKS)
+
+TEST_MCS_FLAGS =
+TEST_LIB_REFS = $(PARENT_PROFILE)System.Xml $(XBUILD_ENGINE) $(XBUILD_FRAMEWORK) $(XBUILD_TASKS) $(XBUILD_UTILITIES) $(PARENT_PROFILE)System.Core
ifeq (4, $(FRAMEWORK_VERSION_MAJOR))
- TEST_MCS_FLAGS += /r:Microsoft.Build.dll
+TEST_LIB_REFS += Microsoft.Build
endif
EXTRA_DISTFILES = \
@@ -41,7 +27,7 @@ EXTRA_DISTFILES = \
Test/test-config-file*
Test/resources/test.dll: Test/resources/test.cs
- $(CSCOMPILE) -target:library Test/resources/test.cs
+ $(CSCOMPILE) -target:library /out:$@ $<
clean-test-resources:
rm -f Test/resources/test.dll
diff --git a/mcs/class/Microsoft.Build.Utilities/Makefile b/mcs/class/Microsoft.Build.Utilities/Makefile
index e44bbc2fe80..b854d2bc853 100644
--- a/mcs/class/Microsoft.Build.Utilities/Makefile
+++ b/mcs/class/Microsoft.Build.Utilities/Makefile
@@ -8,17 +8,13 @@ include $(XBUILD_DIR)/xbuild.make
LIBRARY = Microsoft.Build.Utilities.dll
LIBRARY_NAME = Microsoft.Build.Utilities$(NAME_SUFFIX).dll
-LIB_REFS = System System.Core System.Xml
-LIB_MCS_FLAGS = \
- /r:$(corlib) \
- /r:System.dll \
- /r:System.Core.dll \
- /r:System.Xml.dll \
- /r:$(XBUILD_FRAMEWORK)
+LIB_REFS = $(PARENT_PROFILE)System $(PARENT_PROFILE)System.Core $(PARENT_PROFILE)System.Xml $(XBUILD_FRAMEWORK)
+LIB_MCS_FLAGS =
TEST_RESX_RESOURCES = Test/Microsoft.Build.Utilities/Strings.resources
-TEST_MCS_FLAGS = /r:$(XBUILD_ENGINE) /r:$(XBUILD_FRAMEWORK) -r:System.dll -r:System.Core.dll $(TEST_RESX_RESOURCES:%=-resource:%)
+TEST_LIB_REFS = $(XBUILD_ENGINE) $(XBUILD_FRAMEWORK) $(PARENT_PROFILE)System $(PARENT_PROFILE)System.Core
+TEST_MCS_FLAGS = $(TEST_RESX_RESOURCES:%=-resource:%)
include $(XBUILD_DIR)/xbuild_test.make
include ../../build/library.make
diff --git a/mcs/class/Microsoft.Build/Makefile b/mcs/class/Microsoft.Build/Makefile
index 68cd09eb043..933782ff268 100644
--- a/mcs/class/Microsoft.Build/Makefile
+++ b/mcs/class/Microsoft.Build/Makefile
@@ -7,18 +7,12 @@ include $(XBUILD_DIR)/xbuild.make
LIBRARY = Microsoft.Build.dll
-LIB_REFS = System System.Core System.Xml Microsoft.Build.Engine Microsoft.Build.Framework
+LIB_REFS = $(PARENT_PROFILE)System $(PARENT_PROFILE)System.Core $(PARENT_PROFILE)System.Xml Microsoft.Build.Engine Microsoft.Build.Framework
LIB_MCS_FLAGS = \
- /r:$(corlib) \
- /r:System.dll \
- /r:System.Core.dll \
- /r:System.Xml.dll \
- /r:Microsoft.Build.Engine.dll \
- /r:Microsoft.Build.Framework.dll \
/d:MICROSOFT_BUILD_DLL
-TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) \
- /r:Microsoft.Build.Utilities.v4.0.dll
+TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
+TEST_LIB_REFS = $(XBUILD_UTILITIES)
EXTRA_DISTFILES = \
Microsoft.Build.Internal/ExpressionParser.jay \
diff --git a/mcs/class/Microsoft.VisualC/Makefile b/mcs/class/Microsoft.VisualC/Makefile
index 4110234a980..5d38210947f 100644
--- a/mcs/class/Microsoft.VisualC/Makefile
+++ b/mcs/class/Microsoft.VisualC/Makefile
@@ -4,7 +4,7 @@ include ../../build/rules.make
LIBRARY = Microsoft.VisualC.dll
LIB_REFS = System
-LIB_MCS_FLAGS = /r:$(corlib)
+LIB_MCS_FLAGS =
NO_TEST = yes
include ../../build/library.make
diff --git a/mcs/class/Mono.C5/Makefile b/mcs/class/Mono.C5/Makefile
index 71430e72932..c5f80e37114 100644
--- a/mcs/class/Mono.C5/Makefile
+++ b/mcs/class/Mono.C5/Makefile
@@ -5,7 +5,7 @@ include ../../build/rules.make
LIBRARY = Mono.C5.dll
LIBRARY_SNK = c5.snk
LIB_REFS = System
-LIB_MCS_FLAGS = /r:$(corlib) -nowarn:169,219,414,1030,3001,3005,3006
+LIB_MCS_FLAGS = -nowarn:169,219,414,1030,3001,3005,3006
TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -nowarn:0618 -nowarn:219 -nowarn:169
EXTRA_DISTFILES = \
diff --git a/mcs/class/Mono.CSharp/Makefile b/mcs/class/Mono.CSharp/Makefile
index 5fe1a18705a..d2ed176601d 100644
--- a/mcs/class/Mono.CSharp/Makefile
+++ b/mcs/class/Mono.CSharp/Makefile
@@ -15,9 +15,14 @@ ifndef NO_THREAD_ABORT
REFERENCE_SOURCES_FLAGS += -d:MONO_FEATURE_THREAD_ABORT
endif
-TEST_MCS_FLAGS = -r:System.Core.dll
+TEST_MCS_FLAGS =
+TEST_LIB_REFS = System.Core
LIB_MCS_FLAGS += $(REFERENCE_SOURCES_FLAGS)
include ../../build/library.make
+$(topdir)/mcs/cs-parser.cs:
+ $(MAKE) -C $(topdir)/mcs cs-parser.cs
+
+$(the_lib): $(topdir)/mcs/cs-parser.cs
diff --git a/mcs/class/Mono.Cecil.Mdb/Makefile b/mcs/class/Mono.Cecil.Mdb/Makefile
index 70c759c1dab..50357a7903d 100644
--- a/mcs/class/Mono.Cecil.Mdb/Makefile
+++ b/mcs/class/Mono.Cecil.Mdb/Makefile
@@ -6,7 +6,7 @@ LIBRARY_SNK = ../mono.snk
LIBRARY_PACKAGE = none
LIB_REFS = System Mono.Cecil
-LIB_MCS_FLAGS = /r:$(corlib) /d:CECIL -keyfile:$(LIBRARY_SNK)
+LIB_MCS_FLAGS = /d:CECIL -keyfile:$(LIBRARY_SNK) -publicsign
NO_TEST = yes
NO_INSTALL = yes
diff --git a/mcs/class/Mono.Cecil/Makefile b/mcs/class/Mono.Cecil/Makefile
index 790a21809ff..53aee64f34a 100644
--- a/mcs/class/Mono.Cecil/Makefile
+++ b/mcs/class/Mono.Cecil/Makefile
@@ -6,7 +6,7 @@ LIBRARY_SNK = ../mono.snk
LIBRARY_PACKAGE = none
LIB_REFS = System.Core
-LIB_MCS_FLAGS = /r:$(corlib) -keyfile:$(LIBRARY_SNK) -d:NET_3_5
+LIB_MCS_FLAGS = -keyfile:$(LIBRARY_SNK) -d:NET_3_5 /publicsign
NO_TEST = yes
diff --git a/mcs/class/Mono.CodeContracts/Makefile b/mcs/class/Mono.CodeContracts/Makefile
index 92a7619d104..b5e733dbcd9 100644
--- a/mcs/class/Mono.CodeContracts/Makefile
+++ b/mcs/class/Mono.CodeContracts/Makefile
@@ -6,8 +6,8 @@ LIBRARY = Mono.CodeContracts.dll
LIB_REFS = System System.Core Mono.Cecil Mono.Cecil.Mdb
LIB_MCS_FLAGS =
-#-r:Mono.Cecil.Pdb.dll
-TEST_MCS_FLAGS = -r:System.Core.dll -debug
+TEST_MCS_FLAGS =
+TEST_LIB_REFS = System.Core
include ../../build/library.make
diff --git a/mcs/class/Mono.Data.Tds/Makefile b/mcs/class/Mono.Data.Tds/Makefile
index 4f6cc0ca353..f1764c2282b 100644
--- a/mcs/class/Mono.Data.Tds/Makefile
+++ b/mcs/class/Mono.Data.Tds/Makefile
@@ -4,8 +4,9 @@ include ../../build/rules.make
LIBRARY = Mono.Data.Tds.dll
LIB_REFS = System System.Xml Mono.Security
-LIB_MCS_FLAGS = /r:$(corlib)
+LIB_MCS_FLAGS =
-TEST_MCS_FLAGS = /r:System.dll /r:System.Net.dll
+TEST_MCS_FLAGS =
+TEST_LIB_REFS = System System.Net
include ../../build/library.make
diff --git a/mcs/class/Mono.Debugger.Soft/Makefile b/mcs/class/Mono.Debugger.Soft/Makefile
index 659cf71668e..d92fb61f8a9 100644
--- a/mcs/class/Mono.Debugger.Soft/Makefile
+++ b/mcs/class/Mono.Debugger.Soft/Makefile
@@ -5,9 +5,10 @@ LIBRARY = Mono.Debugger.Soft.dll
LIBRARY_SNK = ../mono.snk
LIB_REFS = System Mono.Cecil System.Core
-LIB_MCS_FLAGS = /r:$(corlib) /unsafe -D:MONO_DATACONVERTER_STATIC_METHODS -keyfile:$(LIBRARY_SNK)
+LIB_MCS_FLAGS = /unsafe -D:MONO_DATACONVERTER_STATIC_METHODS -keyfile:$(LIBRARY_SNK) /publicsign
-TEST_MCS_FLAGS = /r:Mono.Cecil.dll /r:System.dll /r:System.Core.dll
+TEST_MCS_FLAGS =
+TEST_LIB_REFS = Mono.Cecil System System.Core
VALID_TEST_PROFILE := $(filter net_4_x, $(PROFILE))
@@ -17,7 +18,7 @@ ifdef VALID_TEST_PROFILE
test-local: dtest-app.exe dtest-excfilter.exe
dtest-app.exe: Test/dtest-app.cs
- $(CSCOMPILE) -out:$@ -unsafe -debug -optimize- Test/dtest-app.cs
+ $(CSCOMPILE) -r:$(topdir)/class/lib/$(PROFILE)/System.Core.dll -r:$(topdir)/class/lib/$(PROFILE)/System.dll -out:$@ -unsafe $(PLATFORM_DEBUG_FLAGS) -optimize- Test/dtest-app.cs
dtest-excfilter.exe: Test/dtest-excfilter.il
MONO_PATH=$(topdir)/class/lib/$(PROFILE) $(INTERNAL_ILASM) -out:$@ /exe /debug Test/dtest-excfilter.il
@@ -29,7 +30,7 @@ check:
endif
-CLEAN_FILES = dtest-app.exe dtest-app.exe.mdb dtest-excfilter.exe dtest-excfilter.exe.mdb
+CLEAN_FILES = dtest-app.exe dtest-app.exe.mdb dtest-app.pdb dtest-excfilter.exe dtest-excfilter.exe.mdb dtest-excfilter.pdb
EXTRA_DISTFILES = \
Test/dtest-app.cs \
diff --git a/mcs/class/Mono.Directory.LDAP/Makefile b/mcs/class/Mono.Directory.LDAP/Makefile
index 919f24f0d62..040a1801e1c 100644
--- a/mcs/class/Mono.Directory.LDAP/Makefile
+++ b/mcs/class/Mono.Directory.LDAP/Makefile
@@ -4,6 +4,6 @@ include ../../build/rules.make
LIBRARY = Mono.Directory.LDAP.dll
LIB_REFS = System System.Data
-LIB_MCS_FLAGS = /r:$(corlib)
+LIB_MCS_FLAGS =
include ../../build/library.make
diff --git a/mcs/class/Mono.Dynamic.Interpreter/Makefile b/mcs/class/Mono.Dynamic.Interpreter/Makefile
index 903006b49b5..6d9565ccbee 100644
--- a/mcs/class/Mono.Dynamic.Interpreter/Makefile
+++ b/mcs/class/Mono.Dynamic.Interpreter/Makefile
@@ -4,7 +4,7 @@ include ../../build/rules.make
LIBRARY = Mono.Dynamic.Interpreter.dll
-LIB_REFS = System System.Core
+LIB_REFS = System
LIB_MCS_FLAGS = \
-d:FEATURE_CORE_DLR,FEATURE_DBNULL,FEATURE_DEFAULT_PARAMETER_VALUE,FEATURE_GET_TYPE_INFO,FEATURE_VARIANCE,FEATURE_SERIALIZATION,CLR45 \
-d:MONO_INTERPRETER \
@@ -12,7 +12,9 @@ LIB_MCS_FLAGS = \
ifdef MOBILE_STATIC
mono_dynamic_interpreter_deps = $(the_libdir_base)plaincore/System.Core.dll
-LIB_MCS_FLAGS += -lib:$(the_libdir_base)plaincore
+LIB_REFS += plaincore/System.Core
+else
+LIB_REFS += System.Core
endif
include ../../build/library.make
diff --git a/mcs/class/Mono.Http/Makefile b/mcs/class/Mono.Http/Makefile
index d52144b2154..f3801411afa 100644
--- a/mcs/class/Mono.Http/Makefile
+++ b/mcs/class/Mono.Http/Makefile
@@ -4,8 +4,7 @@ include ../../build/rules.make
LIBRARY = Mono.Http.dll
LIB_REFS = System System.Xml System.Web ICSharpCode.SharpZipLib Mono.Security
-LIB_MCS_FLAGS = -r:$(corlib) \
- -nowarn:618
+LIB_MCS_FLAGS = -nowarn:618
NO_TEST = yes
diff --git a/mcs/class/Mono.Management/Makefile b/mcs/class/Mono.Management/Makefile
index c4a97a86a89..5b7c92c5e4d 100644
--- a/mcs/class/Mono.Management/Makefile
+++ b/mcs/class/Mono.Management/Makefile
@@ -5,7 +5,7 @@ include ../../build/rules.make
LIBRARY = Mono.Management.dll
LIB_REFS = System Mono.Posix
-LIB_MCS_FLAGS = /r:$(corlib)
+LIB_MCS_FLAGS =
NO_TEST = yes
include ../../build/library.make
diff --git a/mcs/class/Mono.Messaging.RabbitMQ/Makefile b/mcs/class/Mono.Messaging.RabbitMQ/Makefile
index d07fee59e7e..67f382812d8 100644
--- a/mcs/class/Mono.Messaging.RabbitMQ/Makefile
+++ b/mcs/class/Mono.Messaging.RabbitMQ/Makefile
@@ -6,8 +6,8 @@ LIBRARY = Mono.Messaging.RabbitMQ.dll
LIB_REFS = System System.Messaging Mono.Messaging RabbitMQ.Client
LIB_MCS_FLAGS = -nowarn:618
-TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -nowarn:0618 -nowarn:219 -nowarn:169 \
- /r:nunit.mocks.dll
+TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -nowarn:0618 -nowarn:219 -nowarn:169
+TEST_LIB_REFS = nunit.mocks
include ../../build/library.make
diff --git a/mcs/class/Mono.Messaging/Makefile b/mcs/class/Mono.Messaging/Makefile
index a2e3fbf7b44..7788dfb60c8 100644
--- a/mcs/class/Mono.Messaging/Makefile
+++ b/mcs/class/Mono.Messaging/Makefile
@@ -7,6 +7,7 @@ LIBRARY = Mono.Messaging.dll
LIB_REFS = System System.Configuration
LIB_MCS_FLAGS =
-TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -nowarn:0618 -nowarn:219 -nowarn:169 /r:System.Messaging.dll /r:nunit.mocks.dll
+TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -nowarn:0618 -nowarn:219 -nowarn:169
+TEST_LIB_REFS = System.Messaging nunit.mocks
include ../../build/library.make
diff --git a/mcs/class/Mono.Options/Makefile b/mcs/class/Mono.Options/Makefile
index beee719c77f..2fb4724b281 100644
--- a/mcs/class/Mono.Options/Makefile
+++ b/mcs/class/Mono.Options/Makefile
@@ -8,8 +8,9 @@ LIBRARY_PACKAGE = none
NO_INSTALL = yes
LIB_REFS = System
-LIB_MCS_FLAGS = /r:$(corlib)
-TEST_MCS_FLAGS = /r:Mono.Posix.dll /r:System.dll /r:System.Core.dll
+LIB_MCS_FLAGS =
+TEST_MCS_FLAGS =
+TEST_LIB_REFS = Mono.Posix System System.Core
mono_sourcelibs_DIR = $(DESTDIR)$(mono_libdir)/mono-source-libs
mono_options_DATA = Mono.Options/Options.cs
diff --git a/mcs/class/Mono.Parallel/Makefile b/mcs/class/Mono.Parallel/Makefile
index e2f587ed5e6..75b5aff640b 100644
--- a/mcs/class/Mono.Parallel/Makefile
+++ b/mcs/class/Mono.Parallel/Makefile
@@ -6,7 +6,8 @@ LIBRARY = Mono.Parallel.dll
include ../../build/library.make
-TEST_MCS_FLAGS = /r:System.Core.dll
+TEST_MCS_FLAGS =
+TEST_LIB_REFS = System.Core
LIB_REFS += System.Core System
-LIB_MCS_FLAGS += -d:INSIDE_MONO_PARALLEL -r:$(corlib)
+LIB_MCS_FLAGS += -d:INSIDE_MONO_PARALLEL
diff --git a/mcs/class/Mono.Posix/Makefile b/mcs/class/Mono.Posix/Makefile
index 9cde3498e4d..10d14fc45ed 100644
--- a/mcs/class/Mono.Posix/Makefile
+++ b/mcs/class/Mono.Posix/Makefile
@@ -6,8 +6,9 @@ LIBRARY = Mono.Posix.dll
# Don't warn about [Obsolete] members, as there are now *lots* of [Obsolete]
# members, generating volumes of output.
LIB_REFS = System
-LIB_MCS_FLAGS = /unsafe /r:$(corlib) /nowarn:0618,612
-TEST_MCS_FLAGS = /unsafe /r:Mono.Posix.dll /r:System.dll /nowarn:0219,0618
+LIB_MCS_FLAGS = /unsafe /nowarn:0618,612
+TEST_MCS_FLAGS = /unsafe /nowarn:0219,0618
+TEST_LIB_REFS = Mono.Posix System
LIBRARY_COMPILE = $(BOOT_COMPILE)
diff --git a/mcs/class/Mono.Security.Providers.NewTls/Makefile b/mcs/class/Mono.Security.Providers.NewTls/Makefile
index a5f641229e4..54270bccc55 100644
--- a/mcs/class/Mono.Security.Providers.NewTls/Makefile
+++ b/mcs/class/Mono.Security.Providers.NewTls/Makefile
@@ -3,8 +3,8 @@ SUBDIRS =
include ../../build/rules.make
LIBRARY = Mono.Security.Providers.NewTls.dll
-LIB_MCS_FLAGS = -unsafe -nowarn:1030 -keyfile:../mono.pub -delaysign -r:System.dll \
- -r:NewSystemSource=Mono.Security.Providers.NewSystemSource.dll -r:Mono.Security.dll
+LIB_REFS = System NewSystemSource=Mono.Security.Providers.NewSystemSource Mono.Security
+LIB_MCS_FLAGS = -unsafe -nowarn:1030 -keyfile:../mono.pub -delaysign
include ../../build/library.make
diff --git a/mcs/class/Mono.Security/Makefile b/mcs/class/Mono.Security/Makefile
index 8a873fa9a47..30d065aa304 100644
--- a/mcs/class/Mono.Security/Makefile
+++ b/mcs/class/Mono.Security/Makefile
@@ -4,7 +4,7 @@ include ../../build/rules.make
LIBRARY = Mono.Security.dll
LOCAL_MCS_FLAGS = -lib:$(the_libdir_base)bare
-LIB_REFS = System
+LIB_REFS = bare/System
LIB_MCS_FLAGS = -unsafe -nowarn:1030,3009
TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -nowarn:169,219,618,672
diff --git a/mcs/class/Mono.Simd/Makefile b/mcs/class/Mono.Simd/Makefile
index 3e394f9287d..d8e1e474141 100644
--- a/mcs/class/Mono.Simd/Makefile
+++ b/mcs/class/Mono.Simd/Makefile
@@ -4,8 +4,7 @@ include ../../build/rules.make
LIBRARY = Mono.Simd.dll
LIB_REFS = System.Core
-LIB_MCS_FLAGS = -r:$(corlib) /unsafe
-TEST_MCS_FLAGS = -r:Mono.Simd.dll
+LIB_MCS_FLAGS = /unsafe
NO_TEST = yes
diff --git a/mcs/class/Mono.XBuild.Tasks/Makefile b/mcs/class/Mono.XBuild.Tasks/Makefile
index ef144fe461d..8d50c7ad629 100644
--- a/mcs/class/Mono.XBuild.Tasks/Makefile
+++ b/mcs/class/Mono.XBuild.Tasks/Makefile
@@ -7,11 +7,8 @@ include $(XBUILD_DIR)/xbuild.make
LIBRARY = Mono.XBuild.Tasks.dll
-LIB_REFS = System System.Xml
-LIB_MCS_FLAGS = \
- /r:$(corlib) \
- /r:System.dll \
- /r:System.Xml.dll
+LIB_REFS = $(PARENT_PROFILE)System $(PARENT_PROFILE)System.Xml
+LIB_MCS_FLAGS =
include $(XBUILD_DIR)/xbuild_test.make
diff --git a/mcs/class/Mono.Xml.Ext/Makefile b/mcs/class/Mono.Xml.Ext/Makefile
index 32b46e6664a..e7ac06790fb 100644
--- a/mcs/class/Mono.Xml.Ext/Makefile
+++ b/mcs/class/Mono.Xml.Ext/Makefile
@@ -11,7 +11,7 @@ SCARY_LIB=/lib:$(prefix)/lib
endif
LIB_REFS = System System.Xml
-LIB_MCS_FLAGS = $(SCARY_LIB) /unsafe /r:$(corlib)
+LIB_MCS_FLAGS = $(SCARY_LIB) /unsafe
TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
EXTRA_DISTFILES = \
diff --git a/mcs/class/Novell.Directory.Ldap/Makefile b/mcs/class/Novell.Directory.Ldap/Makefile
index 25cd6cc4fdc..9e0d99d6c0b 100644
--- a/mcs/class/Novell.Directory.Ldap/Makefile
+++ b/mcs/class/Novell.Directory.Ldap/Makefile
@@ -7,9 +7,6 @@ LIBRARY = Novell.Directory.Ldap.dll
LIB_REFS = System Mono.Security
LIB_MCS_FLAGS = \
-warn:1 -nowarn:612 \
- -r:$(corlib) \
- -r:System.dll \
- -r:Mono.Security.dll \
$(RESX_RES:%=/res:%)
include ../../build/library.make
diff --git a/mcs/class/PEAPI/Makefile b/mcs/class/PEAPI/Makefile
index e699f77f53f..f303415ba6d 100644
--- a/mcs/class/PEAPI/Makefile
+++ b/mcs/class/PEAPI/Makefile
@@ -4,7 +4,7 @@ include ../../build/rules.make
LIBRARY = PEAPI.dll
LIB_REFS = System
-LIB_MCS_FLAGS = /r:$(corlib) -nowarn:414,618
+LIB_MCS_FLAGS = -nowarn:414,618
NO_TEST = yes
EXTRA_DISTFILES = README.txt
diff --git a/mcs/class/RabbitMQ.Client/src/apigen/Makefile b/mcs/class/RabbitMQ.Client/src/apigen/Makefile
index 9d5e49a3181..9c48a40e29d 100644
--- a/mcs/class/RabbitMQ.Client/src/apigen/Makefile
+++ b/mcs/class/RabbitMQ.Client/src/apigen/Makefile
@@ -4,9 +4,7 @@ SUBDIRS =
include ../../../../build/rules.make
PROGRAM = RabbitMQ.Client.Apigen.exe
-
-LOCAL_MCS_FLAGS = /r:System.dll \
- /r:System.Xml.dll \
- /main:RabbitMQ.Client.Apigen.Apigen
+LIB_REFS = System System.Xml
+LOCAL_MCS_FLAGS = /main:RabbitMQ.Client.Apigen.Apigen
include ../../../../build/executable.make
diff --git a/mcs/class/System.Configuration.Install/Makefile b/mcs/class/System.Configuration.Install/Makefile
index 2da44f09fe5..cc8b4f8e95c 100644
--- a/mcs/class/System.Configuration.Install/Makefile
+++ b/mcs/class/System.Configuration.Install/Makefile
@@ -3,7 +3,7 @@ include ../../build/rules.make
LIBRARY = System.Configuration.Install.dll
LIB_REFS = System System.Xml
-LIB_MCS_FLAGS = /r:$(corlib)
+LIB_MCS_FLAGS =
NO_TEST = yes
diff --git a/mcs/class/System.Configuration/Makefile b/mcs/class/System.Configuration/Makefile
index 43fc4253383..06575305051 100644
--- a/mcs/class/System.Configuration/Makefile
+++ b/mcs/class/System.Configuration/Makefile
@@ -5,11 +5,11 @@ include ../../build/rules.make
LIBRARY = System.Configuration.dll
-LOCAL_MCS_FLAGS = -lib:$(secxml_libdir) -lib:$(bare_libdir)
-test_remove = $(LOCAL_MCS_FLAGS)
-LIB_REFS = System System.Xml System.Security
-LIB_MCS_FLAGS = -r:$(corlib) -nowarn:618
-TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
+LOCAL_MCS_FLAGS =
+LIB_REFS = secxml/System bare/System.Xml System.Security
+LIB_MCS_FLAGS = -nowarn:618
+TEST_MCS_FLAGS =
+TEST_LIB_REFS = System.Xml System
include ../../build/library.make
diff --git a/mcs/class/System.Data.OracleClient/Makefile b/mcs/class/System.Data.OracleClient/Makefile
index a4415a382bd..2a70299375e 100644
--- a/mcs/class/System.Data.OracleClient/Makefile
+++ b/mcs/class/System.Data.OracleClient/Makefile
@@ -4,7 +4,7 @@ include ../../build/rules.make
LIBRARY = System.Data.OracleClient.dll
LIB_REFS = System System.Xml System.Data System.EnterpriseServices System.Drawing
-LIB_MCS_FLAGS = /r:$(corlib)
+LIB_MCS_FLAGS =
TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) /nowarn:618
diff --git a/mcs/class/System.Data.Services/Makefile b/mcs/class/System.Data.Services/Makefile
index 5f9aeccafce..b5fb3cb6fdd 100644
--- a/mcs/class/System.Data.Services/Makefile
+++ b/mcs/class/System.Data.Services/Makefile
@@ -11,6 +11,7 @@ ifeq (4, $(FRAMEWORK_VERSION_MAJOR))
LIB_REFS += System.ServiceModel.Activation
endif
-TEST_MCS_FLAGS = -r:System.ServiceModel.dll -r:System.Core.dll
+TEST_MCS_FLAGS =
+TEST_LIB_REFS = System.ServiceModel System.Core
include ../../build/library.make
diff --git a/mcs/class/System.Data/Makefile b/mcs/class/System.Data/Makefile
index 9e19d39aed4..0c84bbb1b45 100644
--- a/mcs/class/System.Data/Makefile
+++ b/mcs/class/System.Data/Makefile
@@ -28,7 +28,8 @@ endif
TXT_RESOURCE_STRINGS = ../../../external/referencesource/System.Data/system.data.txt
-TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -r:System.Core.dll -r:Mono.Data.Sqlite.dll -nowarn:618,169,612,219,168
+TEST_LIB_REFS = System.Core Mono.Data.Sqlite
+TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -nowarn:618,169,612,219,168
TEST_MONO_PATH = .
diff --git a/mcs/class/System.Design/Makefile b/mcs/class/System.Design/Makefile
index e941324ef83..3dc11aa3b01 100644
--- a/mcs/class/System.Design/Makefile
+++ b/mcs/class/System.Design/Makefile
@@ -4,13 +4,11 @@ include ../../build/rules.make
LIBRARY = System.Design.dll
-LIB_REFS = System System.Xml System.Web System.Windows.Forms System.Drawing Accessibility System.Data System.Configuration
-LIB_MCS_FLAGS = -r:$(corlib)
+LIB_REFS = System System.Xml plainweb/System.Web System.Windows.Forms System.Drawing Accessibility System.Data System.Configuration
+LIB_MCS_FLAGS =
-plainweb_dir = $(the_libdir_base)plainweb
-LOCAL_MCS_FLAGS = -lib:$(plainweb_dir)
-
-TEST_MCS_FLAGS = /r:System.dll -r:System.Drawing.dll -r:System.Windows.Forms
+TEST_LIB_REFS = System System.Drawing System.Windows.Forms
+TEST_MCS_FLAGS =
include ../../build/library.make
diff --git a/mcs/class/System.DirectoryServices/Makefile b/mcs/class/System.DirectoryServices/Makefile
index ff5403fd06a..7eccfe87a4e 100644
--- a/mcs/class/System.DirectoryServices/Makefile
+++ b/mcs/class/System.DirectoryServices/Makefile
@@ -4,7 +4,7 @@ include ../../build/rules.make
LIBRARY = System.DirectoryServices.dll
LIB_REFS = System Novell.Directory.Ldap
-LIB_MCS_FLAGS = /r:$(corlib)
+LIB_MCS_FLAGS =
TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -nowarn:0618 -nowarn:219 -nowarn:169
include ../../build/library.make
diff --git a/mcs/class/System.Drawing.Design/Makefile b/mcs/class/System.Drawing.Design/Makefile
index 9fa2fea63b5..7abb4b3f3ae 100644
--- a/mcs/class/System.Drawing.Design/Makefile
+++ b/mcs/class/System.Drawing.Design/Makefile
@@ -4,7 +4,7 @@ include ../../build/rules.make
LIBRARY = System.Drawing.Design.dll
LIB_REFS = System System.Drawing System.Windows.Forms
-LIB_MCS_FLAGS = /r:$(corlib)
+LIB_MCS_FLAGS =
NO_TEST = yes
include ../../build/library.make
diff --git a/mcs/class/System.Drawing/Makefile b/mcs/class/System.Drawing/Makefile
index 8827cb4f826..59ff776b9f1 100644
--- a/mcs/class/System.Drawing/Makefile
+++ b/mcs/class/System.Drawing/Makefile
@@ -5,13 +5,14 @@ SUBDIRS =
LIBRARY = System.Drawing.dll
LIB_REFS = System
-LIB_MCS_FLAGS = /unsafe /r:$(corlib) \
+LIB_MCS_FLAGS = /unsafe \
-resource:Assembly/Mono.ico,Mono.ico -resource:Assembly/Information.ico,Information.ico \
-resource:Assembly/Error.ico,Error.ico -resource:Assembly/Warning.ico,Warning.ico \
-resource:Assembly/Question.ico,Question.ico -resource:Assembly/Shield.ico,Shield.ico
+TEST_LIB_REFS = System.Drawing System.Runtime.Serialization.Formatters.Soap System.Xml
+
TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -define:TEST -resource:Test/resources/indexed.png,indexed.png \
- -r:System.Drawing.dll -r:System.Runtime.Serialization.Formatters.Soap.dll -r:System.Xml.dll \
-nowarn:0618 -nowarn:219 -nowarn:169
include ../../build/library.make
diff --git a/mcs/class/System.EnterpriseServices/Makefile b/mcs/class/System.EnterpriseServices/Makefile
index f0eac39bcdf..90f38e9fc9a 100644
--- a/mcs/class/System.EnterpriseServices/Makefile
+++ b/mcs/class/System.EnterpriseServices/Makefile
@@ -4,7 +4,7 @@ include ../../build/rules.make
LIBRARY = System.EnterpriseServices.dll
LIB_REFS = System.Transactions
-LIB_MCS_FLAGS = /nowarn:0168 /nowarn:0162 /r:$(corlib)
+LIB_MCS_FLAGS = /nowarn:0168 /nowarn:0162
NO_TEST = yes
include ../../build/library.make
diff --git a/mcs/class/System.IO.Compression.FileSystem/Makefile b/mcs/class/System.IO.Compression.FileSystem/Makefile
index abc4e30ee80..7cfa024a71d 100644
--- a/mcs/class/System.IO.Compression.FileSystem/Makefile
+++ b/mcs/class/System.IO.Compression.FileSystem/Makefile
@@ -5,6 +5,7 @@ include ../../build/rules.make
LIBRARY = System.IO.Compression.FileSystem.dll
LIB_REFS = System System.IO.Compression
LIB_MCS_FLAGS =
-TEST_MCS_FLAGS = /r:System.dll /r:System.Core.dll /r:System.IO.Compression.dll
+TEST_MCS_FLAGS =
+TEST_LIB_REFS = System System.Core System.IO.Compression
include ../../build/library.make
diff --git a/mcs/class/System.IO.Compression/Makefile b/mcs/class/System.IO.Compression/Makefile
index 3ca6899dacd..0987f09e6e3 100644
--- a/mcs/class/System.IO.Compression/Makefile
+++ b/mcs/class/System.IO.Compression/Makefile
@@ -5,6 +5,7 @@ include ../../build/rules.make
LIBRARY = System.IO.Compression.dll
LIB_REFS = System System.Core
LIB_MCS_FLAGS = /unsafe
-TEST_MCS_FLAGS = /r:System.dll /r:System.Core.dll
+TEST_MCS_FLAGS =
+TEST_LIB_REFS = System System.Core
include ../../build/library.make
diff --git a/mcs/class/System.IdentityModel/Makefile b/mcs/class/System.IdentityModel/Makefile
index 9bf7e1d5877..5a8a72c4c50 100644
--- a/mcs/class/System.IdentityModel/Makefile
+++ b/mcs/class/System.IdentityModel/Makefile
@@ -2,12 +2,6 @@ thisdir = class/System.IdentityModel
SUBDIRS =
include ../../build/rules.make
-ifndef NO_SYSTEM_WEB_APPSERVICES_DEPENDENCY
-ifeq (4, $(FRAMEWORK_VERSION_MAJOR))
-OTHER_LIB_MCS_FLAGS = -r:System.Web.ApplicationServices.dll
-endif
-endif
-
LIBRARY = System.IdentityModel.dll
LIB_REFS = System System.Xml System.Security System.Configuration Mono.Security System.Runtime.Serialization
LIB_MCS_FLAGS = \
@@ -18,6 +12,13 @@ ifndef NO_SYSTEM_WEB_DEPENDENCY
LIB_REFS += System.Web
endif
+
+ifndef NO_SYSTEM_WEB_APPSERVICES_DEPENDENCY
+ifeq (4, $(FRAMEWORK_VERSION_MAJOR))
+LIB_REFS += System.Web.ApplicationServices
+endif
+endif
+
TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
EXTRA_DISTFILES = \
diff --git a/mcs/class/System.Management/Makefile b/mcs/class/System.Management/Makefile
index 4fe9d03dca2..df76cf43bc2 100644
--- a/mcs/class/System.Management/Makefile
+++ b/mcs/class/System.Management/Makefile
@@ -4,7 +4,7 @@ include ../../build/rules.make
LIBRARY = System.Management.dll
LIB_REFS = System System.Configuration.Install
-LIB_MCS_FLAGS = /r:$(corlib)
+LIB_MCS_FLAGS =
NO_TEST = yes
include ../../build/library.make
diff --git a/mcs/class/System.Messaging/Makefile b/mcs/class/System.Messaging/Makefile
index 4cf4c29ab08..0412ea01555 100644
--- a/mcs/class/System.Messaging/Makefile
+++ b/mcs/class/System.Messaging/Makefile
@@ -10,8 +10,8 @@ LIB_REFS += System.Drawing
endif
LIB_MCS_FLAGS = /resource:System.Messaging/MessageQueue.resx
-TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -nowarn:0618 -nowarn:219 -nowarn:169 \
- /r:nunit.mocks.dll
+TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -nowarn:0618 -nowarn:219 -nowarn:169
+TEST_LIB_REFS = nunit.mocks
EXTRA_DISTFILES = System.Messaging/MessageQueue.resx
diff --git a/mcs/class/System.Net.Http.WebRequest/Makefile b/mcs/class/System.Net.Http.WebRequest/Makefile
index fad726ff5f3..b0d8e7a1a87 100644
--- a/mcs/class/System.Net.Http.WebRequest/Makefile
+++ b/mcs/class/System.Net.Http.WebRequest/Makefile
@@ -7,6 +7,7 @@ LIBRARY = System.Net.Http.WebRequest.dll
LIB_REFS = System.Net.Http System
LIB_MCS_FLAGS =
-TEST_MCS_FLAGS = -r:System.Net.Http.dll
+TEST_MCS_FLAGS =
+TEST_LIB_REFS = System.Net.Http
include ../../build/library.make
diff --git a/mcs/class/System.Net.Http/Makefile b/mcs/class/System.Net.Http/Makefile
index aa3cdf921e5..bf1cbbd2799 100644
--- a/mcs/class/System.Net.Http/Makefile
+++ b/mcs/class/System.Net.Http/Makefile
@@ -7,6 +7,7 @@ LIBRARY = System.Net.Http.dll
LIB_REFS = System.Core System
LIB_MCS_FLAGS = $(EXTRA_LIB_MCS_FLAGS)
-TEST_MCS_FLAGS = -r:System.dll -r:System.Core.dll
+TEST_LIB_REFS = System System.Core
+TEST_MCS_FLAGS =
include ../../build/library.make
diff --git a/mcs/class/System.Reactive.Core/Makefile b/mcs/class/System.Reactive.Core/Makefile
index 8e5efe308ce..fc666baf51c 100644
--- a/mcs/class/System.Reactive.Core/Makefile
+++ b/mcs/class/System.Reactive.Core/Makefile
@@ -5,8 +5,7 @@ include ../../build/rules.make
LIBRARY = System.Reactive.Core.dll
LIB_REFS = System System.Core System.Reactive.Interfaces
LIB_MCS_FLAGS = \
- @more_build_args \
- -r:System.Reactive.Interfaces.dll
+ @more_build_args
ifeq (true, $(GENERATE_RESOURCES))
LIB_MCS_FLAGS += /define:GENERATING_RESOURCES
diff --git a/mcs/class/System.Reactive.Linq/Makefile b/mcs/class/System.Reactive.Linq/Makefile
index e05d3c0236e..f7f8f44e195 100644
--- a/mcs/class/System.Reactive.Linq/Makefile
+++ b/mcs/class/System.Reactive.Linq/Makefile
@@ -5,8 +5,7 @@ include ../../build/rules.make
LIBRARY = System.Reactive.Linq.dll
LIB_REFS = System System.Core System.Reactive.Interfaces System.Reactive.Core
LIB_MCS_FLAGS = \
- @more_build_args \
- -r:System.Reactive.Core.dll
+ @more_build_args
ifeq (true, $(GENERATE_RESOURCES))
LIB_MCS_FLAGS += /define:GENERATING_RESOURCES
diff --git a/mcs/class/System.Reactive.Observable.Aliases/Makefile b/mcs/class/System.Reactive.Observable.Aliases/Makefile
index ec5e06a73a8..0db9de14052 100644
--- a/mcs/class/System.Reactive.Observable.Aliases/Makefile
+++ b/mcs/class/System.Reactive.Observable.Aliases/Makefile
@@ -5,8 +5,7 @@ include ../../build/rules.make
LIBRARY = System.Reactive.Observable.Aliases.dll
LIB_REFS = System System.Core System.Reactive.Interfaces System.Reactive.Core System.Reactive.Linq System.Reactive.Providers
LIB_MCS_FLAGS = \
- @more_build_args \
- -r:System.Reactive.Providers.dll
+ @more_build_args
ifeq (true, $(GENERATE_RESOURCES))
LIB_MCS_FLAGS += /define:GENERATING_RESOURCES
diff --git a/mcs/class/System.Reactive.PlatformServices/Makefile b/mcs/class/System.Reactive.PlatformServices/Makefile
index 1a8675dc69a..0333c27f2e7 100644
--- a/mcs/class/System.Reactive.PlatformServices/Makefile
+++ b/mcs/class/System.Reactive.PlatformServices/Makefile
@@ -5,8 +5,7 @@ include ../../build/rules.make
LIBRARY = System.Reactive.PlatformServices.dll
LIB_REFS = System System.Core System.Reactive.Interfaces System.Reactive.Core System.Reactive.Linq
LIB_MCS_FLAGS = \
- @more_build_args \
- -r:System.Reactive.Linq.dll
+ @more_build_args
ifeq (true, $(GENERATE_RESOURCES))
LIB_MCS_FLAGS += /define:GENERATING_RESOURCES
@@ -35,7 +34,8 @@ ifndef NO_TASK_DELAY
LIB_MCS_FLAGS += -d:NO_TASK_DELAY
endif
-TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -r:Mono.Reactive.Tests.dll
+TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
+TEST_LIB_REFS = Mono.Reactive.Tests
EXTRA_DISTFILES = more_build_args $(RESX_RESOURCES:.resources=.resx) $(PREBUILT)
diff --git a/mcs/class/System.Reactive.Providers/Makefile b/mcs/class/System.Reactive.Providers/Makefile
index 9aedac157d7..ab1f274d150 100644
--- a/mcs/class/System.Reactive.Providers/Makefile
+++ b/mcs/class/System.Reactive.Providers/Makefile
@@ -5,8 +5,7 @@ include ../../build/rules.make
LIBRARY = System.Reactive.Providers.dll
LIB_REFS = System System.Core System.Reactive.Interfaces System.Reactive.Core System.Reactive.Linq
LIB_MCS_FLAGS = \
- @more_build_args \
- -r:System.Reactive.Linq.dll
+ @more_build_args
ifeq (true, $(GENERATE_RESOURCES))
LIB_MCS_FLAGS += /define:GENERATING_RESOURCES
diff --git a/mcs/class/System.Reactive.Runtime.Remoting/Makefile b/mcs/class/System.Reactive.Runtime.Remoting/Makefile
index 389920631a7..1834e7aaa25 100644
--- a/mcs/class/System.Reactive.Runtime.Remoting/Makefile
+++ b/mcs/class/System.Reactive.Runtime.Remoting/Makefile
@@ -5,8 +5,7 @@ include ../../build/rules.make
LIBRARY = System.Reactive.Runtime.Remoting.dll
LIB_REFS = System System.Core System.Reactive.Interfaces System.Reactive.Core System.Reactive.Linq
LIB_MCS_FLAGS = \
- @more_build_args \
- -r:System.Reactive.Linq.dll
+ @more_build_args
ifeq (2.1, $(FRAMEWORK_VERSION))
LIB_MCS_FLAGS += -d:NO_TASK_DELAY
diff --git a/mcs/class/System.Reactive.Windows.Forms/Makefile b/mcs/class/System.Reactive.Windows.Forms/Makefile
index e2f9d24fa92..ef3327d3e3e 100644
--- a/mcs/class/System.Reactive.Windows.Forms/Makefile
+++ b/mcs/class/System.Reactive.Windows.Forms/Makefile
@@ -5,8 +5,7 @@ include ../../build/rules.make
LIBRARY = System.Reactive.Windows.Forms.dll
LIB_REFS = System System.Core System.Reactive.Interfaces System.Reactive.Core System.Reactive.Linq System.Windows.Forms
LIB_MCS_FLAGS = \
- @more_build_args \
- -r:System.Windows.Forms.dll
+ @more_build_args
ifeq (2.1, $(FRAMEWORK_VERSION))
LIB_MCS_FLAGS += -d:NO_TASK_DELAY -d:HAS_AWAIT
diff --git a/mcs/class/System.Reactive.Windows.Threading/Makefile b/mcs/class/System.Reactive.Windows.Threading/Makefile
index 3c0654cfac3..66a3ff14f6c 100644
--- a/mcs/class/System.Reactive.Windows.Threading/Makefile
+++ b/mcs/class/System.Reactive.Windows.Threading/Makefile
@@ -5,8 +5,7 @@ include ../../build/rules.make
LIBRARY = System.Reactive.Windows.Threading.dll
LIB_REFS = System System.Core System.Reactive.Interfaces System.Reactive.Core System.Reactive.Linq WindowsBase
LIB_MCS_FLAGS = \
- @more_build_args \
- -r:WindowsBase.dll
+ @more_build_args
ifeq (true, $(GENERATE_RESOURCES))
LIB_MCS_FLAGS += /define:GENERATING_RESOURCES
diff --git a/mcs/class/System.Runtime.Remoting/Makefile b/mcs/class/System.Runtime.Remoting/Makefile
index eeb73d0894e..323d4241eb5 100644
--- a/mcs/class/System.Runtime.Remoting/Makefile
+++ b/mcs/class/System.Runtime.Remoting/Makefile
@@ -5,13 +5,14 @@ include ../../build/rules.make
LIBRARY = System.Runtime.Remoting.dll
LIB_REFS = System System.Xml System.Runtime.Serialization.Formatters.Soap
-LIB_MCS_FLAGS = /r:$(corlib)
+LIB_MCS_FLAGS =
ifndef NO_SYSTEM_WEB_DEPENDENCY
LIB_REFS += System.Web
endif
-TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -nowarn:618 /r:System.Runtime.Remoting.dll
+TEST_MCS_FLAGS = -nowarn:618
+TEST_LIB_REFS = System System.Xml
TEST_MONO_PATH = .
diff --git a/mcs/class/System.Runtime.Serialization.Formatters.Soap/Makefile b/mcs/class/System.Runtime.Serialization.Formatters.Soap/Makefile
index 76d3270616d..7a673f01fa3 100644
--- a/mcs/class/System.Runtime.Serialization.Formatters.Soap/Makefile
+++ b/mcs/class/System.Runtime.Serialization.Formatters.Soap/Makefile
@@ -6,8 +6,10 @@ include ../../build/rules.make
LIBRARY = System.Runtime.Serialization.Formatters.Soap.dll
LIB_REFS = System.Xml
-LIB_MCS_FLAGS = /r:$(corlib)
-TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -r:System.dll -nowarn:0618 -nowarn:219 -nowarn:169
+LIB_MCS_FLAGS =
+
+TEST_LIB_REFS = System
+TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -nowarn:0618 -nowarn:219 -nowarn:169
EXTRA_DISTFILES = \
README \
diff --git a/mcs/class/System.Runtime.Serialization/Makefile b/mcs/class/System.Runtime.Serialization/Makefile
index 21d8e716a39..19894c49fd9 100644
--- a/mcs/class/System.Runtime.Serialization/Makefile
+++ b/mcs/class/System.Runtime.Serialization/Makefile
@@ -27,8 +27,8 @@ TEST_RESOURCE_FILES = \
Test/Resources/WSDL/collections.wsdl \
Test/Resources/WSDL/custom-collections.wsdl
-TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) /r:System.ServiceModel.dll /r:System.Web.Services.dll \
- $(TEST_RESOURCE_FILES:%=/resource:%)
+TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) $(TEST_RESOURCE_FILES:%=/resource:%)
+TEST_LIB_REFS = System.ServiceModel System.Web.Services
EXTRA_DISTFILES = $(RESOURCE_FILES) $(TEST_RESOURCE_FILES) \
Test/Resources/FrameworkTypes/* \
diff --git a/mcs/class/System.Security/Makefile b/mcs/class/System.Security/Makefile
index 03e2493cc26..451a06e2f4c 100644
--- a/mcs/class/System.Security/Makefile
+++ b/mcs/class/System.Security/Makefile
@@ -3,10 +3,9 @@ SUBDIRS =
include ../../build/rules.make
LIBRARY = System.Security.dll
-LIB_REFS = System System.Xml Mono.Security
+LIB_REFS = secxml/System bare/System.Xml Mono.Security
LIB_MCS_FLAGS = -nowarn:618 \
-d:SECURITY_DEP \
- -r:$(corlib) \
-nowarn:414
LOCAL_MCS_FLAGS = -lib:$(secxml_libdir) -lib:$(bare_libdir)
diff --git a/mcs/class/System.ServiceModel.Activation/Makefile b/mcs/class/System.ServiceModel.Activation/Makefile
index ad7f73f1b92..2be1563c1d7 100644
--- a/mcs/class/System.ServiceModel.Activation/Makefile
+++ b/mcs/class/System.ServiceModel.Activation/Makefile
@@ -4,14 +4,13 @@ include ../../build/rules.make
LIBRARY = System.ServiceModel.Activation.dll
-LIB_REFS = System.Core System System.ServiceModel
+LIB_REFS = System.Core System plainservice/System.ServiceModel
LIB_MCS_FLAGS =
-TEST_MCS_FLAGS = -r:System.dll -r:System.Core.dll
+TEST_MCS_FLAGS =
+TEST_LIB_REFS = System System.Core
-plainservicemodel_dir = $(the_libdir_base)plainservice
-servicemodel = $(plainservicemodel_dir)/System.ServiceModel.dll
-LOCAL_MCS_FLAGS = -lib:$(plainservicemodel_dir)
+servicemodel = $(the_libdir_base)plainservice/System.ServiceModel.dll
include ../../build/library.make
diff --git a/mcs/class/System.ServiceModel.Discovery/Makefile b/mcs/class/System.ServiceModel.Discovery/Makefile
index 75422d19e74..d46df268454 100644
--- a/mcs/class/System.ServiceModel.Discovery/Makefile
+++ b/mcs/class/System.ServiceModel.Discovery/Makefile
@@ -8,8 +8,7 @@ LIB_MCS_FLAGS =
ifneq (2.1, $(FRAMEWORK_VERSION))
LIB_REFS += System.Configuration
-LIB_MCS_FLAGS += -d:NET_3_5 -d:NET_3_0 \
- -r:System.Configuration.dll
+LIB_MCS_FLAGS += -d:NET_3_5 -d:NET_3_0
endif
TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
diff --git a/mcs/class/System.ServiceModel.Routing/Makefile b/mcs/class/System.ServiceModel.Routing/Makefile
index ad9a78e6a60..f8d30f60025 100644
--- a/mcs/class/System.ServiceModel.Routing/Makefile
+++ b/mcs/class/System.ServiceModel.Routing/Makefile
@@ -8,8 +8,7 @@ LIB_MCS_FLAGS =
ifneq (2.1, $(FRAMEWORK_VERSION))
LIB_REFS += System.Configuration
-LIB_MCS_FLAGS += -d:NET_3_5 -d:NET_3_0 \
- -r:System.Configuration.dll
+LIB_MCS_FLAGS += -d:NET_3_5 -d:NET_3_0
endif
TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
diff --git a/mcs/class/System.ServiceModel/Makefile b/mcs/class/System.ServiceModel/Makefile
index 03dbd5fd9e5..5f09e6a2329 100644
--- a/mcs/class/System.ServiceModel/Makefile
+++ b/mcs/class/System.ServiceModel/Makefile
@@ -34,7 +34,8 @@ activation = $(the_libdir_base)System.ServiceModel.Activation.dll
servicemodel_deps = $(activation)
ifneq (plainservice/,$(intermediate))
-LIB_MCS_FLAGS += -define:HAS_ACTIVATION -r:System.ServiceModel.Activation.dll
+LIB_REFS += System.ServiceModel.Activation
+LIB_MCS_FLAGS += -define:HAS_ACTIVATION
endif
endif # NO_SYSTEM_SERVICEMODEL_ACTIVATION_DEPENDENCY
diff --git a/mcs/class/System.Threading.Tasks.Dataflow/Makefile b/mcs/class/System.Threading.Tasks.Dataflow/Makefile
index 349e5c75754..017f1a880c8 100644
--- a/mcs/class/System.Threading.Tasks.Dataflow/Makefile
+++ b/mcs/class/System.Threading.Tasks.Dataflow/Makefile
@@ -7,8 +7,9 @@ LIBRARY = System.Threading.Tasks.Dataflow.dll
include ../../build/library.make
LIB_REFS += System.Core System
-LIB_MCS_FLAGS += -r:$(corlib) -d:CONCURRENT_COLLECTIONS
+LIB_MCS_FLAGS += -d:CONCURRENT_COLLECTIONS
-TEST_MCS_FLAGS = -r:System.Core.dll -r:System.dll
+TEST_MCS_FLAGS =
+TEST_LIB_REFS = System.Core System
EXTRA_DISTFILES=README.md
diff --git a/mcs/class/System.Transactions/Makefile b/mcs/class/System.Transactions/Makefile
index 08e9bd68021..07672c10b06 100644
--- a/mcs/class/System.Transactions/Makefile
+++ b/mcs/class/System.Transactions/Makefile
@@ -5,10 +5,10 @@ include ../../build/rules.make
LIBRARY = System.Transactions.dll
ifdef MOBILE_PROFILE
LIB_REFS = System
-LIB_MCS_FLAGS = /r:$(corlib) /define:MOBILE
+LIB_MCS_FLAGS = /define:MOBILE
else
LIB_REFS = System System.Configuration
-LIB_MCS_FLAGS = /r:$(corlib)
+LIB_MCS_FLAGS =
endif
TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
diff --git a/mcs/class/System.Web.DynamicData/Makefile b/mcs/class/System.Web.DynamicData/Makefile
index 08cb7d04c2b..df81a3719ca 100644
--- a/mcs/class/System.Web.DynamicData/Makefile
+++ b/mcs/class/System.Web.DynamicData/Makefile
@@ -160,11 +160,11 @@ TEST_RESOURCE_FILES = \
NUNIT_RESOURCE_FILES = $(TEST_RESOURCE_FILES)
-TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -r:System.ComponentModel.DataAnnotations.dll -r:System.Configuration.dll \
- $(NUNIT_RESOURCE_FILES:%=/resource:%) -r:SystemWebTestShim.dll -r:System.Xml.dll
+TEST_LIB_REFS = System.ComponentModel.DataAnnotations System.Configuration SystemWebTestShim System.Xml
+TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) $(NUNIT_RESOURCE_FILES:%=/resource:%)
ifeq (4, $(FRAMEWORK_VERSION_MAJOR))
-TEST_MCS_FLAGS += -r:System.Web.ApplicationServices.dll
+TEST_LIB_REFS += System.Web.ApplicationServices
endif
EXTRA_DISTFILES = $(foreach resource,$(TEST_RESOURCE_FILES), $(shell echo $(subst \`,\\\`,$(resource)) | cut -d ',' -f 1))
diff --git a/mcs/class/System.Web.Extensions/Makefile b/mcs/class/System.Web.Extensions/Makefile
index bf15f32944f..4a3f8a48970 100644
--- a/mcs/class/System.Web.Extensions/Makefile
+++ b/mcs/class/System.Web.Extensions/Makefile
@@ -39,7 +39,7 @@ NUNIT_RESOURCE_FILES= \
CLASSLIB_DIR = $(topdir)/class/lib/$(PROFILE)
STANDALONE_RUNNER_SUPPORT_ASSEMBLY = $(CLASSLIB_DIR)/standalone-runner-support.dll
-STANDALONE_TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) $(PROFILE_MCS_FLAGS) -debug:full -r:$(STANDALONE_RUNNER_SUPPORT_ASSEMBLY) -r:System.Web.dll -r:System.Web.Extensions.dll -r:nunit.framework.dll
+STANDALONE_TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) $(PROFILE_MCS_FLAGS) -r:$(STANDALONE_RUNNER_SUPPORT_ASSEMBLY) -r:$(topdir)/class/lib/$(PROFILE)/System.Web.dll -r:$(topdir)/class/lib/$(PROFILE)/System.Web.Extensions.dll -r:$(topdir)/class/lib/$(PROFILE)/nunit.framework.dll
STANDALONE_TEST_ASSEMBLY = System.Web.Extensions_standalone_test_$(PROFILE).dll
STANDALONE_TEST_MAKEFRAG = $(depsdir)/$(STANDALONE_TEST_ASSEMBLY).makefrag
@@ -49,20 +49,20 @@ ifdef TESTNAME
RUN_STANDALONE += --test=$(TESTNAME)
endif
-ifeq (4, $(FRAMEWORK_VERSION_MAJOR))
-OTHER_LIB_MCS_FLAGS += -r:System.Web.ApplicationServices.dll
-endif
-
LIB_REFS = System System.Core System.Drawing System.Data System.Data.Linq System.Xml System.Web System.Web.Services System.Configuration System.EnterpriseServices System.ServiceModel
LIB_MCS_FLAGS = \
-unsafe \
-define:NET_3_5 \
-define:SYSTEM_WEB_EXTENSIONS \
- -r:$(corlib) \
$(OTHER_LIB_MCS_FLAGS) \
$(RESOURCE_FILES:%=/resource:%)
-TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -doc:$(test_lib:.dll=.xml) -nowarn:219,169,1591 $(NUNIT_RESOURCE_FILES:%=/resource:%) -r:SystemWebTestShim.dll -define:SYSTEM_WEB_EXTENSIONS
+ifeq (4, $(FRAMEWORK_VERSION_MAJOR))
+LIB_REFS += System.Web.ApplicationServices
+endif
+
+TEST_LIB_REFS = SystemWebTestShim
+TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -doc:$(test_lib:.dll=.xml) -nowarn:219,169,1591 $(NUNIT_RESOURCE_FILES:%=/resource:%) -define:SYSTEM_WEB_EXTENSIONS
EXTRA_DISTFILES = $(RESOURCE_FILES_DIST) $(NUNIT_RESOURCE_FILES) \
System.Web.Extensions_standalone_test.dll.sources \
diff --git a/mcs/class/System.Web.Services/Makefile b/mcs/class/System.Web.Services/Makefile
index c189f7963eb..0e8dd48092a 100644
--- a/mcs/class/System.Web.Services/Makefile
+++ b/mcs/class/System.Web.Services/Makefile
@@ -7,9 +7,6 @@ ifdef MOBILE_PROFILE
LIB_REFS = System System.Xml
LIB_MCS_FLAGS = \
-nowarn:649 -nowarn:169 \
- -r:$(corlib) \
- -r:System.dll \
- -r:System.Xml.dll \
-resource:System.Web.Services.Description/wsdl-1.1.xsd,wsdl-1.1.xsd \
-resource:System.Web.Services.Description/wsdl-1.1-soap.xsd,wsdl-1.1-soap.xsd \
-resource:System.Web.Services.Description/web-reference.xsd,web-reference.xsd
@@ -18,19 +15,15 @@ LIB_REFS = System System.EnterpriseServices System.Xml System.Data
LIB_MCS_FLAGS = -nowarn:168,169,219,414,612,649 -d:MONO_BROKEN_CONFIGURATION_DLL
ifndef NO_SYSTEM_WEB_DEPENDENCY
-LIB_REFS += System.Web
-plainweb_dir = $(the_libdir_base)plainweb
-plainweb = $(plainweb_dir)/System.Web.dll
-system_web_services_deps = $(plainweb)
-LOCAL_MCS_FLAGS += -lib:$(plainweb_dir)
+plainweb = $(the_libdir_base)plainweb/System.Web.dll
+system_web_deps = $(plainweb)
+LIB_REFS += plainweb/System.Web
endif
ifndef NO_SYSTEM_DESIGN_DEPENDENCY
-LIB_REFS += System.Design
-plaindesign_dir = $(the_libdir_base)plaindesign
-plaindesign = $(plaindesign_dir)/System.Design.dll
+plaindesign = $(the_libdir_base)plaindesign/System.Design.dll
system_design_deps = $(plaindesign)
-LOCAL_MCS_FLAGS += -lib:$(plaindesign_dir)
+LIB_REFS += plaindesign/System.Design
endif
ifndef NO_SYSTEM_DIRECTORY_SERVICES_DEPENDENCY
@@ -63,7 +56,7 @@ EXTRA_DISTFILES = \
include ../../build/library.make
-$(the_libdir_base)$(LIBRARY): $(system_web_services_deps) $(system_design_deps)
+$(the_libdir_base)$(LIBRARY): $(system_web_deps) $(system_design_deps)
$(plainweb):
(cd ../System.Web; $(MAKE) $@)
diff --git a/mcs/class/System.Web/Makefile b/mcs/class/System.Web/Makefile
index 72f14d10577..9656cafa25b 100644
--- a/mcs/class/System.Web/Makefile
+++ b/mcs/class/System.Web/Makefile
@@ -233,33 +233,33 @@ NUNIT_APP_CODE_FILES = $(TEST_APP_CODE_FILES)
NUNIT_APP_GLOBALRESOURCES_FILES = $(TEST_APP_GLOBALRESOURCES_FILES)
OTHER_RES += $(RESOURCE_FILES_2)
-OTHER_LIB_MCS_FLAGS = -d:INSIDE_SYSTEM_WEB -nowarn:618 -r:System.Configuration.dll -r:Mono.Data.Sqlite.dll
+OTHER_LIB_MCS_FLAGS = -d:INSIDE_SYSTEM_WEB -nowarn:618
ifeq (4, $(FRAMEWORK_VERSION_MAJOR))
-OTHER_LIB_MCS_FLAGS += -r:System.Web.ApplicationServices.dll
OTHER_RES += $(RESOURCE_FILES_4)
endif
TXT_RESOURCE_STRINGS = ../../../external/referencesource/System.Web/System.Web.txt
-LIB_REFS = System System.Core System.Drawing System.Data System.Xml System.EnterpriseServices System.Runtime.Serialization.Formatters.Soap System.ComponentModel.DataAnnotations
+LIB_REFS = System System.Core System.Drawing System.Data System.Xml System.EnterpriseServices System.Runtime.Serialization.Formatters.Soap \
+ System.ComponentModel.DataAnnotations System.Web.ApplicationServices System.Configuration Mono.Data.Sqlite
LIB_MCS_FLAGS = \
-unsafe \
-nowarn:612,618 \
- -r:$(corlib) \
$(OTHER_LIB_MCS_FLAGS) \
$(RESX_RES:%=/resource:%) \
$(OTHER_RES:%=/resource:%)
ifneq (plainweb/,$(intermediate))
-LIB_REFS += System.Web.Services System.Design
+LIB_REFS += System.Web.Services plaindesign/System.Design
LIB_MCS_FLAGS += -define:WEBSERVICES_DEP -lib:$(the_libdir_base)plaindesign
all-local: System.Web/UplevelHelper.cs resources/TranslationResources.resources
endif
-TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -doc:$(test_lib:.dll=.xml) -nowarn:219,169,1591 -r:SystemWebTestShim.dll \
+TEST_LIB_REFS = SystemWebTestShim
+TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -doc:$(test_lib:.dll=.xml) -nowarn:219,169,1591 \
$(NUNIT_RESOURCE_FILES:%=/resource:%) \
$(foreach file,$(NUNIT_APP_CODE_FILES),$(shell echo $(file) | sed -e 's;\(.*\)/\(.*\);/resource:\1/\2,App_Code/\2 ;g')) \
$(foreach file,$(NUNIT_APP_GLOBALRESOURCES_FILES),$(shell echo $(file) | sed -e 's;\(.*\)/\(.*\);/resource:\1/\2,App_GlobalResources/\2 ;g'))
@@ -322,11 +322,11 @@ endif
CLASSLIB_DIR = $(topdir)/class/lib/$(PROFILE)
-STANDALONE_RUNNER_SUPPORT_MCS_FLAGS = $(LIB_MCS_FLAGS) $(PROFILE_MCS_FLAGS) -d:STANDALONE_TEST -debug:full -r:System.Web.dll -r:nunit.framework.dll
+STANDALONE_RUNNER_SUPPORT_MCS_FLAGS = $(LIB_MCS_FLAGS) $(PROFILE_MCS_FLAGS) -d:STANDALONE_TEST -r:$(topdir)/class/lib/$(PROFILE)/System.Web.dll -r:$(topdir)/class/lib/$(PROFILE)/nunit.framework.dll
STANDALONE_RUNNER_SUPPORT_ASSEMBLY = $(CLASSLIB_DIR)/standalone-runner-support.dll
STANDALONE_RUNNER_SUPPORT_MAKEFRAG = $(depsdir)/$(PROFILE)_standalone-runner-support.dll.makefrag
-STANDALONE_TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) $(PROFILE_MCS_FLAGS) -debug:full -r:$(STANDALONE_RUNNER_SUPPORT_ASSEMBLY) -r:System.Web.dll -r:nunit.framework.dll
+STANDALONE_TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) $(PROFILE_MCS_FLAGS) -r:$(STANDALONE_RUNNER_SUPPORT_ASSEMBLY) -r:$(topdir)/class/lib/$(PROFILE)/System.Web.dll -r:$(topdir)/class/lib/$(PROFILE)/nunit.framework.dll
STANDALONE_TEST_ASSEMBLY = System.Web_standalone_test_$(PROFILE).dll
STANDALONE_TEST_MAKEFRAG = $(depsdir)/$(STANDALONE_TEST_ASSEMBLY).makefrag
diff --git a/mcs/class/System.Web/Test/tools/Makefile b/mcs/class/System.Web/Test/tools/Makefile
index bfe9f95caa2..9cbb4159d00 100644
--- a/mcs/class/System.Web/Test/tools/Makefile
+++ b/mcs/class/System.Web/Test/tools/Makefile
@@ -10,9 +10,9 @@ STANDALONE_RUNNER_SOURCES = \
../../../Mono.Options/Mono.Options/Options.cs \
STANDALONE_RUNNER_REFERENCES = \
- -lib:$(CLASSLIB_DIR) \
-r:$(STANDALONE_RUNNER_SUPPORT_ASSEMBLY) \
- -r:System.Web.dll
+ -r:$(CLASSLIB_DIR)/System.Web.dll \
+ -r:$(CLASSLIB_DIR)/System.dll
CACHE_PQ_TEST_GENERATOR_SOURCES = \
CachePQTestGenerator/CacheItemComparer.cs \
@@ -27,7 +27,6 @@ CACHE_PQ_TEST_GENERATOR_SOURCES = \
../System.Web.Caching/CacheItemPriorityQueueTestSupport.cs
CACHE_PQ_TEST_GENERATOR_REFERENCES = \
- -lib:$(CLASSLIB_DIR) \
-pkg:dotnet
CACHE_PQ_TEST_SEQUENCES = $(wildcard ./CachePQTestGenerator/Sequences/*.seq)
@@ -36,13 +35,13 @@ CACHE_PQ_TEST_PACKED_SEQUENCES = $(wildcard ./CachePQTestGenerator/Sequences/*.s
all-local: HtmlWriter.dll standalone-runner.exe cache-pq-test-generator.exe
HtmlWriter.dll: HtmlWriter.cs
- $(MCS) -t:library -r:System.Web.dll $<
+ $(CSCOMPILE) -t:library -r:System.Web.dll $<
standalone-runner.exe: deps $(STANDALONE_RUNNER_SOURCES)
- $(MCS) -debug:full $(STANDALONE_RUNNER_REFERENCES) -out:$@ $(STANDALONE_RUNNER_SOURCES)
+ $(CSCOMPILE) $(STANDALONE_RUNNER_REFERENCES) -out:$@ $(STANDALONE_RUNNER_SOURCES)
cache-pq-test-generator.exe: $(CACHE_PQ_TEST_GENERATOR_SOURCES)
- $(MCS) -debug:full -d:DEBUG $(CACHE_PQ_TEST_GENERATOR_REFERENCES) -out:$@ $(CACHE_PQ_TEST_GENERATOR_SOURCES)
+ $(CSCOMPILE) -d:DEBUG $(CACHE_PQ_TEST_GENERATOR_REFERENCES) -out:$@ $(CACHE_PQ_TEST_GENERATOR_SOURCES)
generate-cache-pq-tests: cache-pq-test-generator.exe
for f in $(patsubst %.seq.gz,%.seq,$(CACHE_PQ_TEST_PACKED_SEQUENCES)); do \
diff --git a/mcs/class/System.Windows.Forms/Makefile b/mcs/class/System.Windows.Forms/Makefile
index 3d8113656cf..06eacbcbcf7 100644
--- a/mcs/class/System.Windows.Forms/Makefile
+++ b/mcs/class/System.Windows.Forms/Makefile
@@ -5,7 +5,6 @@ LIBRARY = System.Windows.Forms.dll
LIB_REFS = System System.Xml System.Drawing Accessibility System.Data Mono.Posix Mono.WebBrowser System.Configuration System.Runtime.Serialization.Formatters.Soap
LIB_MCS_FLAGS = /unsafe \
- /r:$(corlib) \
@System.Windows.Forms.dll.resources \
-nowarn:618,612,809
@@ -100,13 +99,15 @@ EXTRA_DISTFILES = \
$(IMAGES_RESOURCES) \
$(TEST_DISTFILES)
-TEST_MCS_FLAGS = /r:System.Data.dll /r:System.Drawing.dll /r:Accessibility.dll -r:System.dll -r:System.Xml.dll -r:System.Runtime.Serialization.Formatters.Soap\
+TEST_LIB_REFS = System.Data System.Drawing Accessibility System System.Xml System.Runtime.Serialization.Formatters.Soap
+TEST_MCS_FLAGS = \
-resource:Test/resources/a.cur,a.cur \
-resource:Test/resources/32x32.ico,32x32.ico \
-nowarn:618,612
DummyAssembly.dll:
- $(CSCOMPILE) /target:library /out:$@ Test/DummyAssembly/AnotherSerializable.cs Test/DummyAssembly/Convertable.cs Test/DummyAssembly/Properties/AssemblyInfo.cs
+ $(CSCOMPILE) /target:library /out:$@ Test/DummyAssembly/AnotherSerializable.cs Test/DummyAssembly/Convertable.cs Test/DummyAssembly/Properties/AssemblyInfo.cs \
+ -r:$(topdir)/class/lib/$(PROFILE)/System.dll
test-local: DummyAssembly.dll
diff --git a/mcs/class/System.XML/Makefile b/mcs/class/System.XML/Makefile
index 183612a1053..e66bd2e4635 100644
--- a/mcs/class/System.XML/Makefile
+++ b/mcs/class/System.XML/Makefile
@@ -17,23 +17,24 @@ TXT_RESOURCE_STRINGS = \
../../../external/referencesource/System.Xml/System.Xml.txt \
../../../external/referencesource/System.Data.SqlXml/System.Xml.Utils.txt
-LIB_REFS = System
-LIB_MCS_FLAGS = -r:$(corlib) -nowarn:219,414,649,1717 -unsafe -d:ASYNC
+LIB_MCS_FLAGS = -nowarn:219,414,649,1717 -unsafe -d:ASYNC
ifeq (2.1, $(FRAMEWORK_VERSION))
LIB_MCS_FLAGS += -d:AGCLR -d:NET_2_1_HACK -d:DISABLE_XSLT_COMPILER -d:DISABLE_XSLT_SCRIPT,MONO_HYBRID_SYSTEM_XML -d:DISABLE_CAS_USE
endif
-TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -nowarn:0618 -nowarn:219 -nowarn:169 -r:System.Data.dll -r:System.Core.dll
-ifndef MOBILE_PROFILE
-FINAL_MCS_FLAGS = -r:System.Configuration.dll -d:CONFIGURATION_DEP
-endif
+TEST_LIB_REFS = System.Data System.Core
+TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -nowarn:0618 -nowarn:219 -nowarn:169
ifneq (bare/,$(intermediate))
-LIB_MCS_FLAGS += $(FINAL_MCS_FLAGS)
+LIB_REFS += secxml/System
+ifndef MOBILE_PROFILE
+LIB_REFS += System.Configuration
+LIB_MCS_FLAGS += -d:CONFIGURATION_DEP
+endif
+else
+LIB_REFS += $(intermediate)System
endif
-
-LOCAL_MCS_FLAGS += -lib:$(bare_libdir)
nist_dom_files = \
ITest.cs readme.txt util.cs \
diff --git a/mcs/class/System/Makefile b/mcs/class/System/Makefile
index 25031265acc..1e19b0dd5bc 100644
--- a/mcs/class/System/Makefile
+++ b/mcs/class/System/Makefile
@@ -19,7 +19,9 @@ TEST_RESOURCES = \
Test/System/test-uri-props-manual.txt \
Test/System/test-uri-relative-props.txt
-TEST_MCS_FLAGS = -r:System.Drawing.dll -r:Mono.Security.dll -r:System.Data.dll -r:System.Xml.dll -r:System.Core.dll -nowarn:618,672,219,67,169,612 \
+TEST_LIB_REFS = System.Drawing Mono.Security System.Data System.Xml System.Core System.Configuration
+
+TEST_MCS_FLAGS = -nowarn:618,672,219,67,169,612 \
$(foreach f, $(TEST_RESOURCES), -resource:$(f),$(notdir $(f)))
REFERENCE_SOURCES_FLAGS = -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX
@@ -29,7 +31,6 @@ TEST_MCS_FLAGS += -d:MONO_FEATURE_PROCESS_START
endif
LIB_MCS_FLAGS = -nowarn:618 -d:CONFIGURATION_2_0 $(REFERENCE_SOURCES_FLAGS) -unsafe $(RESOURCE_FILES:%=-resource:%)
-TEST_MCS_FLAGS += -r:System.Configuration.dll
ifndef NO_THREAD_ABORT
REFERENCE_SOURCES_FLAGS += -d:MONO_FEATURE_THREAD_ABORT
@@ -50,7 +51,6 @@ ifdef MOBILE_PROFILE
LIB_MCS_FLAGS += -d:INSIDE_SYSTEM -d:SECURITY_DEP
else
EXTERN_ALIAS_FLAGS = -d:MONO_SECURITY_ALIAS -d:MONO_X509_ALIAS
-FINAL_MCS_FLAGS = -r:System.Configuration.dll -d:CONFIGURATION_DEP
endif
#
@@ -58,7 +58,7 @@ endif
#
ifeq (secxml/, $(intermediate))
LOCAL_MCS_FLAGS = -lib:$(bare_libdir)
-LIB_REFS += System.Xml MonoSecurity=Mono.Security
+LIB_REFS += bare/System.Xml MonoSecurity=Mono.Security
LIB_MCS_FLAGS += -d:SECURITY_DEP -d:XML_DEP -r:PrebuiltSystem=$(bare_libdir)/System.dll $(EXTERN_ALIAS_FLAGS)
endif
@@ -67,7 +67,13 @@ endif
#
ifndef intermediate
LIB_REFS += System.Xml MonoSecurity=Mono.Security
-LIB_MCS_FLAGS += -d:SECURITY_DEP -d:XML_DEP -r:PrebuiltSystem=$(secxml_libdir)/System.dll $(EXTERN_ALIAS_FLAGS) $(FINAL_MCS_FLAGS)
+LIB_MCS_FLAGS += -d:SECURITY_DEP -d:XML_DEP -r:PrebuiltSystem=$(secxml_libdir)/System.dll $(EXTERN_ALIAS_FLAGS)
+
+ifndef MOBILE_PROFILE
+LIB_REFS += System.Configuration
+LIB_MCS_FLAGS += -d:CONFIGURATION_DEP
+endif
+
endif
EXTRA_DISTFILES = \
diff --git a/mcs/class/WebMatrix.Data/Makefile b/mcs/class/WebMatrix.Data/Makefile
index 476d3be7c22..2ee3b170c48 100644
--- a/mcs/class/WebMatrix.Data/Makefile
+++ b/mcs/class/WebMatrix.Data/Makefile
@@ -5,7 +5,8 @@ include ../../build/rules.make
LIBRARY = WebMatrix.Data.dll
LIB_REFS = System System.Data System.Core System.Configuration
-LIB_MCS_FLAGS = -r:$(corlib)
-TEST_MCS_FLAGS = -r:System.dll -r:System.Core.dll -r:System.Data.dll -r:Mono.Data.Sqlite.dll -r:Microsoft.CSharp.dll
+LIB_MCS_FLAGS =
+TEST_MCS_FLAGS =
+TEST_LIB_REFS = System System.Core System.Data Mono.Data.Sqlite Microsoft.CSharp
include ../../build/library.make
diff --git a/mcs/class/WindowsBase/Makefile b/mcs/class/WindowsBase/Makefile
index 172a501446e..842c1ed0ebe 100644
--- a/mcs/class/WindowsBase/Makefile
+++ b/mcs/class/WindowsBase/Makefile
@@ -5,14 +5,15 @@ LIBRARY = WindowsBase.dll
LIB_REFS = System System.Xml
LIB_MCS_FLAGS = -unsafe
-TEST_MCS_FLAGS = -unsafe -r:WindowsBase.dll -r:System.dll -r:System.Xml.dll -r:System.Core.dll
+TEST_MCS_FLAGS = -unsafe
+TEST_LIB_REFS = WindowsBase System System.Xml System.Core
ifeq (2.0, $(FRAMEWORK_VERSION))
LIB_MCS_FLAGS += -d:NET_3_0
endif
ifeq (4, $(FRAMEWORK_VERSION_MAJOR))
LIB_REFS += System.Xaml
-TEST_MCS_FLAGS += -r:System.Xaml.dll
+TEST_LIB_REFS += System.Xaml
endif
include ../../build/library.make
diff --git a/mcs/class/corlib/Makefile b/mcs/class/corlib/Makefile
index aff30966f5a..b633c23c6e8 100644
--- a/mcs/class/corlib/Makefile
+++ b/mcs/class/corlib/Makefile
@@ -61,14 +61,14 @@ WARNING_ABOUT_DISABLED_WARNING=1635
LOCAL_MCS_FLAGS = -unsafe -nostdlib -nowarn:612,618,$(WARNING_ABOUT_DISABLED_WARNING) -d:INSIDE_CORLIB,MONO_CULTURE_DATA -d:LIBC $(REFERENCE_SOURCES_FLAGS)
DEFAULT_REFERENCES =
-ifdef MOBILE_STATIC
-CORLIB_MONO_POSIX_REF =
-else
-CORLIB_MONO_POSIX_REF = -r:Mono.Posix.dll
+TEST_LIB_REFS = System.Core System
+
+ifndef MOBILE_STATIC
+TEST_LIB_REFS += Mono.Posix
endif
# System.IO/DirectoryInfoTest.cs needs Mono.Posix
-TEST_MCS_FLAGS += -debug -nowarn:168,219,618,672 -unsafe $(CORLIB_MONO_POSIX_REF) -r:System.Core.dll -r:System.dll \
+TEST_MCS_FLAGS += -debug -nowarn:168,219,618,672 -unsafe \
-define:MONO_DATACONVERTER_STATIC_METHODS $(TEST_RESX_RESOURCES:%=-resource:%)
EXTRA_DISTFILES = \
@@ -108,11 +108,11 @@ $(test_lib): $(TEST_RESOURCES) $(satellite_assembly1) $(satellite_assembly2)
$(satellite_assembly1): Test/resources/culture-es-ES.cs Test/resources/Resources.es-ES.resources
@mkdir -p es-ES
- $(CSCOMPILE) -target:library -r:$(corlib) Test/resources/culture-es-ES.cs -resource:Test/resources/Resources.es-ES.resources -out:$@
+ $(CSCOMPILE) -target:library -r:$(topdir)/class/lib/$(PROFILE)/mscorlib.dll Test/resources/culture-es-ES.cs -resource:Test/resources/Resources.es-ES.resources -out:$@
$(satellite_assembly2): Test/resources/culture-nn-NO.cs Test/resources/Resources.nn-NO.resources
@mkdir -p nn-NO
- $(CSCOMPILE) -target:library -r:$(corlib) Test/resources/culture-nn-NO.cs -resource:Test/resources/Resources.nn-NO.resources -out:$@
+ $(CSCOMPILE) -target:library -r:$(topdir)/class/lib/$(PROFILE)/mscorlib.dll Test/resources/culture-nn-NO.cs -resource:Test/resources/Resources.nn-NO.resources -out:$@
vtsdir = Test/System.Runtime.Serialization.Formatters.Binary/VersionTolerantSerialization
vtslibs = \
@@ -127,11 +127,13 @@ test-vts: $(vtslibs) $(vtsdir)/$(PROFILE)_TestLib/BinarySerializationOverVersion
$(vtsdir)/$(PROFILE)_TestLib/%/Address.dll: $(vtsdir)/VersionTolerantSerializationTestLib/%/Address.cs
@mkdir -p $(dir $@)
- $(CSCOMPILE) -target:library -r:$(corlib) -warn:0 -out:$@ $^
+ $(CSCOMPILE) -target:library -warn:0 -r:$(topdir)/class/lib/$(PROFILE)/mscorlib.dll -out:$@ $^
$(vtsdir)/$(PROFILE)_TestLib/BinarySerializationOverVersions.exe: $(vtsdir)/BinarySerializationOverVersions.cs $(vtsdir)/$(PROFILE)_TestLib/1.0/Address.dll $(test_nunit_dep)
- $(CSCOMPILE) $(test_nunit_ref) -warn:0 -r:$(corlib) \
+ $(CSCOMPILE) $(test_nunit_ref) -warn:0 \
-r:$(vtsdir)/$(PROFILE)_TestLib/1.0/Address.dll \
+ -r:$(topdir)/class/lib/$(PROFILE)/mscorlib.dll \
+ -r:$(topdir)/class/lib/$(PROFILE)/System.dll \
$(vtsdir)/BinarySerializationOverVersions.cs -out:$@
@cp $(vtsdir)/$(PROFILE)_TestLib/1.0/Address.dll $(vtsdir)/$(PROFILE)_TestLib
diff --git a/mcs/class/monodoc/Makefile b/mcs/class/monodoc/Makefile
index 1c85d9abac6..50f84cfd617 100644
--- a/mcs/class/monodoc/Makefile
+++ b/mcs/class/monodoc/Makefile
@@ -111,11 +111,12 @@ LIB_MCS_FLAGS = \
/resource:Resources/mono-ecma.xsl,mono-ecma.xsl \
/resource:Resources/toc-html.xsl,toc-html.xsl \
$(IMAGE_RESOURCE_COMMAND) \
- /r:$(corlib)
+ /publicsign
CLEAN_FILES += $(the_lib).config
-TEST_MCS_FLAGS = /r:System.dll /r:System.Core.dll /r:System.Xml.dll
+TEST_MCS_FLAGS =
+TEST_LIB_REFS = System System.Core System.Xml
DOC_SOURCE_DIRS = \
../../docs \
diff --git a/mcs/nunit24/ClientUtilities/util/Makefile b/mcs/nunit24/ClientUtilities/util/Makefile
index fe0910186fe..7a291b287a7 100644
--- a/mcs/nunit24/ClientUtilities/util/Makefile
+++ b/mcs/nunit24/ClientUtilities/util/Makefile
@@ -5,11 +5,8 @@ include ../../../build/rules.make
LIBRARY = nunit.util.dll
LIBRARY_SNK = $(topdir)/nunit24/nunit.snk
-LOCAL_MCS_FLAGS= \
- /resource:Transform.resources,NUnit.Util.Transform.resources \
- -r:nunit.core.dll -r:nunit.core.interfaces.dll -r:System.dll \
- -r:System.Xml.dll -r:System.Runtime.Remoting.dll \
- /d:MONO /d:StronglyNamedAssembly -warn:1
+LOCAL_MCS_FLAGS= /resource:Transform.resources,NUnit.Util.Transform.resources /d:MONO /d:StronglyNamedAssembly /publicsign -warn:1
+LIB_REFS = nunit.core nunit.core.interfaces System System.Xml System.Runtime.Remoting
NO_TEST = yo
RESX_RES = Transform.resources
diff --git a/mcs/nunit24/ConsoleRunner/nunit-console-exe/Makefile b/mcs/nunit24/ConsoleRunner/nunit-console-exe/Makefile
index b09931ffef6..72ce02dc429 100644
--- a/mcs/nunit24/ConsoleRunner/nunit-console-exe/Makefile
+++ b/mcs/nunit24/ConsoleRunner/nunit-console-exe/Makefile
@@ -3,9 +3,9 @@ SUBDIRS =
include ../../../build/rules.make
PROGRAM = nunit-console.exe
-LOCAL_MCS_FLAGS = \
- /r:nunit.framework.dll /r:nunit.util.dll /r:nunit.core.dll \
- /r:nunit-console-runner.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = nunit.framework nunit.util nunit.core nunit-console-runner
+
EXTRA_DISTFILES = App.ico \
nunit-console.exe.csproj \
nunit-console.exe_VS2005.csproj \
diff --git a/mcs/nunit24/ConsoleRunner/nunit-console/Makefile b/mcs/nunit24/ConsoleRunner/nunit-console/Makefile
index 52fe21bf61b..b72165aba26 100644
--- a/mcs/nunit24/ConsoleRunner/nunit-console/Makefile
+++ b/mcs/nunit24/ConsoleRunner/nunit-console/Makefile
@@ -5,10 +5,8 @@ include ../../../build/rules.make
LIBRARY = nunit-console-runner.dll
LIBRARY_SNK = $(topdir)/nunit24/nunit.snk
-LOCAL_MCS_FLAGS= \
- -r:nunit.core.dll -r:nunit.core.interfaces.dll -r:nunit.util.dll \
- -r:System.dll -r:System.Xml.dll \
- /d:MONO /d:StronglyNamedAssembly
+LOCAL_MCS_FLAGS= /d:MONO /d:StronglyNamedAssembly /publicsign
+LIB_REFS = nunit.core nunit.core.interfaces nunit.util System System.Xml
NO_TEST = yo
EXTRA_DISTFILES = nunit-console.csproj nunit-console_VS2005.csproj
diff --git a/mcs/nunit24/NUnitCore/core/Makefile b/mcs/nunit24/NUnitCore/core/Makefile
index ac3b0146fbf..83a2e01bd0e 100644
--- a/mcs/nunit24/NUnitCore/core/Makefile
+++ b/mcs/nunit24/NUnitCore/core/Makefile
@@ -5,7 +5,8 @@ include ../../../build/rules.make
LIBRARY = nunit.core.dll
LIBRARY_SNK = $(topdir)/nunit24/nunit.snk
-LOCAL_MCS_FLAGS= -r:nunit.framework.dll -r:nunit.core.interfaces.dll -r:System.dll /d:StronglyNamedAssembly -warn:1
+LOCAL_MCS_FLAGS = /d:StronglyNamedAssembly -warn:1 /publicsign
+LIB_REFS = nunit.framework nunit.core.interfaces System
NO_TEST = yo
EXTRA_DISTFILES = nunit.core.dll.csproj nunit.core.dll_VS2005.csproj
diff --git a/mcs/nunit24/NUnitCore/interfaces/Makefile b/mcs/nunit24/NUnitCore/interfaces/Makefile
index e9ddcc79faf..592ce5bc160 100644
--- a/mcs/nunit24/NUnitCore/interfaces/Makefile
+++ b/mcs/nunit24/NUnitCore/interfaces/Makefile
@@ -5,7 +5,8 @@ include ../../../build/rules.make
LIBRARY = nunit.core.interfaces.dll
LIBRARY_SNK = $(topdir)/nunit24/nunit.snk
-LOCAL_MCS_FLAGS= -debug -r:nunit.framework.dll -r:System.dll /d:StronglyNamedAssembly
+LOCAL_MCS_FLAGS= /d:StronglyNamedAssembly /publicsign
+LIB_REFS = nunit.framework System
NO_TEST = yo
EXTRA_DISTFILES = nunit.core.interfaces.dll.csproj nunit.core.interfaces.dll_VS2005.csproj
diff --git a/mcs/nunit24/NUnitExtensions/core/Makefile b/mcs/nunit24/NUnitExtensions/core/Makefile
index 48f8ccf8f6f..9e3ba945a67 100644
--- a/mcs/nunit24/NUnitExtensions/core/Makefile
+++ b/mcs/nunit24/NUnitExtensions/core/Makefile
@@ -5,10 +5,8 @@ include ../../../build/rules.make
LIBRARY = nunit.core.extensions.dll
LIBRARY_SNK = $(topdir)/nunit24/nunit.snk
-LIB_MCS_FLAGS = \
- -debug \
- /r:nunit.core.dll /r:nunit.core.interfaces.dll \
- /r:System.Xml.dll /r:System.dll /d:StronglyNamedAssembly
+LIB_MCS_FLAGS = /d:StronglyNamedAssembly /publicsign
+LIB_REFS = nunit.core nunit.core.interfaces System.Xml System
NO_TEST = yo
EXTRA_DISTFILES = \
diff --git a/mcs/nunit24/NUnitExtensions/framework/Makefile b/mcs/nunit24/NUnitExtensions/framework/Makefile
index 81d6b15439d..7cd03514e37 100644
--- a/mcs/nunit24/NUnitExtensions/framework/Makefile
+++ b/mcs/nunit24/NUnitExtensions/framework/Makefile
@@ -5,7 +5,8 @@ include ../../../build/rules.make
LIBRARY = nunit.framework.extensions.dll
LIBRARY_SNK = $(topdir)/nunit24/nunit.snk
-LIB_MCS_FLAGS = -debug /r:System.Xml.dll /r:System.dll /d:StronglyNamedAssembly
+LIB_MCS_FLAGS = /d:StronglyNamedAssembly /publicsign
+LIB_REFS = System.Xml System
NO_TEST = yo
EXTRA_DISTFILES = \
diff --git a/mcs/nunit24/NUnitFramework/framework/Makefile b/mcs/nunit24/NUnitFramework/framework/Makefile
index 157b0b4d578..43076d8c855 100644
--- a/mcs/nunit24/NUnitFramework/framework/Makefile
+++ b/mcs/nunit24/NUnitFramework/framework/Makefile
@@ -6,7 +6,8 @@ LIBRARY = NUnit.Framework.dll
LIBRARY_NAME = nunit.framework.dll
LIBRARY_SNK = $(topdir)/nunit24/nunit.snk
-LIB_MCS_FLAGS = /r:System.Xml.dll /r:System.dll /d:StronglyNamedAssembly -warn:1
+LIB_MCS_FLAGS = /d:StronglyNamedAssembly -warn:1 /publicsign
+LIB_REFS = System.Xml System
NO_TEST = yo
EXTRA_DISTFILES = \
diff --git a/mcs/nunit24/NUnitMocks/mocks/Makefile b/mcs/nunit24/NUnitMocks/mocks/Makefile
index b9769c4777d..0c6ab3ca272 100644
--- a/mcs/nunit24/NUnitMocks/mocks/Makefile
+++ b/mcs/nunit24/NUnitMocks/mocks/Makefile
@@ -5,7 +5,8 @@ include ../../../build/rules.make
LIBRARY = nunit.mocks.dll
LIBRARY_SNK = $(topdir)/nunit24/nunit.snk
-LOCAL_MCS_FLAGS= -debug -r:nunit.framework.dll -r:System.dll /d:StronglyNamedAssembly
+LOCAL_MCS_FLAGS= /d:StronglyNamedAssembly /publicsign
+LIB_REFS = nunit.framework System
NO_TEST = yo
EXTRA_DISTFILES = \
diff --git a/mcs/tools/Makefile b/mcs/tools/Makefile
index 418bcdd85f5..d95558b3083 100644
--- a/mcs/tools/Makefile
+++ b/mcs/tools/Makefile
@@ -16,6 +16,7 @@ net_4_5_dirs := \
xbuild \
csharp \
corcompare \
+ mono-api-html \
compiler-tester \
mono-xmltool \
mono-shlib-cop \
diff --git a/mcs/tools/al/Makefile b/mcs/tools/al/Makefile
index a4505c123f5..280ddc00554 100644
--- a/mcs/tools/al/Makefile
+++ b/mcs/tools/al/Makefile
@@ -2,7 +2,8 @@ thisdir = tools/al
SUBDIRS =
include ../../build/rules.make
-LOCAL_MCS_FLAGS = -r:Mono.Security.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = Mono.Security
PROGRAM = al.exe
CLEAN_FILES = al.exe al.exe.mdb
diff --git a/mcs/tools/browsercaps-updater/Makefile b/mcs/tools/browsercaps-updater/Makefile
index a39c748e5e6..6d2df98702d 100644
--- a/mcs/tools/browsercaps-updater/Makefile
+++ b/mcs/tools/browsercaps-updater/Makefile
@@ -2,7 +2,8 @@ thisdir = tools/browsercaps-updater
SUBDIRS =
include ../../build/rules.make
-LOCAL_MCS_FLAGS = -r:System.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = System
PROGRAM = browsercaps-updater.exe
diff --git a/mcs/tools/cccheck/Makefile b/mcs/tools/cccheck/Makefile
index 71935aebb6c..52d624ffed4 100644
--- a/mcs/tools/cccheck/Makefile
+++ b/mcs/tools/cccheck/Makefile
@@ -4,6 +4,7 @@ include ../../build/rules.make
PROGRAM = cccheck.exe
-LOCAL_MCS_FLAGS = -r:Mono.CodeContracts.dll -r:System.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = Mono.CodeContracts System
include ../../build/executable.make
diff --git a/mcs/tools/ccrewrite/Makefile b/mcs/tools/ccrewrite/Makefile
index bac67d3de8a..00e711b2795 100644
--- a/mcs/tools/ccrewrite/Makefile
+++ b/mcs/tools/ccrewrite/Makefile
@@ -4,6 +4,7 @@ include ../../build/rules.make
PROGRAM = ccrewrite.exe
-LOCAL_MCS_FLAGS = -r:Mono.CodeContracts.dll -r:System.dll -r:System.Core.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = Mono.CodeContracts System System.Core
include ../../build/executable.make
diff --git a/mcs/tools/cil-stringreplacer/Makefile b/mcs/tools/cil-stringreplacer/Makefile
index 9b07560ab39..a6708e2d371 100644
--- a/mcs/tools/cil-stringreplacer/Makefile
+++ b/mcs/tools/cil-stringreplacer/Makefile
@@ -5,6 +5,6 @@ include ../../build/rules.make
PROGRAM = cil-stringreplacer.exe
NO_INSTALL = yes
-LOCAL_MCS_FLAGS = -r:System.dll -r:Mono.Cecil.dll
+LIB_REFS = System Mono.Cecil
include ../../build/executable.make
diff --git a/mcs/tools/cil-strip/Makefile b/mcs/tools/cil-strip/Makefile
index 6c3154589a6..e84d78325e6 100644
--- a/mcs/tools/cil-strip/Makefile
+++ b/mcs/tools/cil-strip/Makefile
@@ -2,7 +2,8 @@ thisdir = tools/cil-strip
SUBDIRS =
include ../../build/rules.make
-LOCAL_MCS_FLAGS = -r:System.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = System
PROGRAM = mono-cil-strip.exe
diff --git a/mcs/tools/compiler-tester/Makefile b/mcs/tools/compiler-tester/Makefile
index 2e0ec2bc8df..b3c2a5a450a 100644
--- a/mcs/tools/compiler-tester/Makefile
+++ b/mcs/tools/compiler-tester/Makefile
@@ -5,6 +5,7 @@ include ../../build/rules.make
PROGRAM = compiler-tester.exe
NO_INSTALL = yes
-LOCAL_MCS_FLAGS = -r:System.dll -r:System.Core.dll -r:System.Xml.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = System System.Core System.Xml
include $(topdir)/build/executable.make
diff --git a/mcs/tools/corcompare/Makefile b/mcs/tools/corcompare/Makefile
index 760f9cf5045..2f4a664387a 100644
--- a/mcs/tools/corcompare/Makefile
+++ b/mcs/tools/corcompare/Makefile
@@ -2,63 +2,9 @@ thisdir = tools/corcompare
SUBDIRS =
include ../../build/rules.make
-ALL_PROGRAMS = mono-api-info.exe mono-api-html.exe
+LIB_REFS = Mono.Cecil System.Xml System.Core System
+LOCAL_MCS_FLAGS =
-PROGRAM_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)
+PROGRAM = mono-api-info.exe
-APIINFO_SOURCES = \
- mono-api-info.cs \
- AssemblyResolver.cs \
- Util.cs \
- WellFormedXmlWriter.cs \
- ../../class/Mono.Options/Mono.Options/Options.cs
-
-APIHTML_SOURCES = \
- mono-api-html/ApiChange.cs \
- mono-api-html/ApiDiff.cs \
- mono-api-html/AssemblyComparer.cs \
- mono-api-html/ClassComparer.cs \
- mono-api-html/Comparer.cs \
- mono-api-html/ConstructorComparer.cs \
- mono-api-html/EventComparer.cs \
- mono-api-html/FieldComparer.cs \
- mono-api-html/Helpers.cs \
- mono-api-html/InterfaceComparer.cs \
- mono-api-html/MemberComparer.cs \
- mono-api-html/MethodComparer.cs \
- mono-api-html/NamespaceComparer.cs \
- mono-api-html/PropertyComparer.cs \
- ../../class/Mono.Options/Mono.Options/Options.cs
-
-
-DISTFILES= $(APIINFO_SOURCES) $(APIHTML_SOURCES)
-
-all-local: $(ALL_PROGRAMS)
-
-csproj-local doc-update-local:
-
-install-local: $(ALL_PROGRAMS)
- $(MKINSTALLDIRS) $(DESTDIR)$(PROGRAM_INSTALL_DIR)
- for i in $(ALL_PROGRAMS) ; do \
- $(INSTALL_BIN) $$i $(DESTDIR)$(PROGRAM_INSTALL_DIR) ; \
- done
-
-uninstall-local:
- for i in $(ALL_PROGRAMS) ; do \
- rm -f $(DESTDIR)$(PROGRAM_INSTALL_DIR)/`basename $$i` ; \
- done
-
-test-local:
-
-run-test-local run-test-ondotnet-local:
-
-clean-local:
- rm -f *.exe *.pdb
-
-dist-local: dist-default
-
-mono-api-info.exe: $(APIINFO_SOURCES)
- $(CSCOMPILE) -r:Mono.Cecil.dll -r:System.Xml.dll -r:System.Core.dll -r:System.dll -out:$@ $^
-
-mono-api-html.exe: $(APIHTML_SOURCES)
- $(CSCOMPILE) -r:Mono.Cecil.dll -r:System.Xml.dll -r:System.Core.dll -r:System.dll -r:System.Xml.Linq.dll -out:$@ $^
+include ../../build/executable.make
diff --git a/mcs/tools/corcompare/mono-api-info.exe.sources b/mcs/tools/corcompare/mono-api-info.exe.sources
new file mode 100644
index 00000000000..9ae6cd0588b
--- /dev/null
+++ b/mcs/tools/corcompare/mono-api-info.exe.sources
@@ -0,0 +1,5 @@
+AssemblyResolver.cs
+Util.cs
+WellFormedXmlWriter.cs
+mono-api-info.cs
+../../class/Mono.Options/Mono.Options/Options.cs
diff --git a/mcs/tools/csharp/Makefile b/mcs/tools/csharp/Makefile
index 7a03be5761c..1c3a80355ee 100644
--- a/mcs/tools/csharp/Makefile
+++ b/mcs/tools/csharp/Makefile
@@ -6,7 +6,8 @@ include ../../build/rules.make
// 3021: CLS attribute not needed since assembly is not CLS compliant
NOWARNS = -nowarn:3021
-LOCAL_MCS_FLAGS = -r:$(topdir)/class/lib/$(PROFILE)/Mono.CSharp.dll -r:$(topdir)/class/lib/$(PROFILE)/Mono.Posix.dll -r:Mono.Management.dll -r:System.dll -unsafe $(NOWARNS)
+LOCAL_MCS_FLAGS = -unsafe $(NOWARNS)
+LIB_REFS = Mono.CSharp Mono.Posix Mono.Management System
PROGRAM = csharp.exe
diff --git a/mcs/tools/culevel/Makefile b/mcs/tools/culevel/Makefile
index cfc68da2310..c186b8e74a2 100644
--- a/mcs/tools/culevel/Makefile
+++ b/mcs/tools/culevel/Makefile
@@ -2,7 +2,7 @@ thisdir = tools/culevel
SUBDIRS =
include ../../build/rules.make
-LOCAL_MCS_FLAGS = -r:System.dll -r:System.Xml.dll
+LIB_REFS = System System.Xml
PROGRAM = culevel.exe
CLEAN_FILES = culevel.exe culevel.exe.mdb
diff --git a/mcs/tools/disco/Makefile b/mcs/tools/disco/Makefile
index 12869f51ecf..77721fa1df1 100644
--- a/mcs/tools/disco/Makefile
+++ b/mcs/tools/disco/Makefile
@@ -2,7 +2,8 @@ thisdir = tools/disco
SUBDIRS =
include ../../build/rules.make
-LOCAL_MCS_FLAGS = -r:System.Xml.dll -r:System.Web.Services.dll -r:System.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = System.Xml System.Web.Services System
PROGRAM = disco.exe
include ../../build/executable.make
diff --git a/mcs/tools/dtd2rng/Makefile b/mcs/tools/dtd2rng/Makefile
index 48e0059409c..14f8c2906b9 100644
--- a/mcs/tools/dtd2rng/Makefile
+++ b/mcs/tools/dtd2rng/Makefile
@@ -2,7 +2,8 @@ thisdir = tools/dtd2rng
SUBDIRS =
include ../../build/rules.make
-LOCAL_MCS_FLAGS = -r:System.Xml.dll -r:Commons.Xml.Relaxng.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = System.Xml Commons.Xml.Relaxng
PROGRAM = dtd2rng.exe
include ../../build/executable.make
diff --git a/mcs/tools/dtd2xsd/Makefile b/mcs/tools/dtd2xsd/Makefile
index 80431266b27..fa500c8c679 100755
--- a/mcs/tools/dtd2xsd/Makefile
+++ b/mcs/tools/dtd2xsd/Makefile
@@ -2,7 +2,8 @@ thisdir = tools/dtd2xsd
SUBDIRS =
include ../../build/rules.make
-LOCAL_MCS_FLAGS = -r:System.Xml.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = System.Xml
PROGRAM = dtd2xsd.exe
include ../../build/executable.make
diff --git a/mcs/tools/gacutil/Makefile b/mcs/tools/gacutil/Makefile
index 878830f1248..f98314ecec7 100644
--- a/mcs/tools/gacutil/Makefile
+++ b/mcs/tools/gacutil/Makefile
@@ -2,7 +2,8 @@ thisdir = tools/gacutil
SUBDIRS =
include ../../build/rules.make
-LOCAL_MCS_FLAGS = -r:Mono.Security.dll -unsafe
+LIB_REFS = Mono.Security
+LOCAL_MCS_FLAGS = -unsafe
PROGRAM = gacutil.exe
diff --git a/mcs/tools/genxs/Makefile b/mcs/tools/genxs/Makefile
index 21b38e8fd3c..71819a2eb52 100644
--- a/mcs/tools/genxs/Makefile
+++ b/mcs/tools/genxs/Makefile
@@ -2,7 +2,8 @@ thisdir = tools/genxs
SUBDIRS =
include ../../build/rules.make
-LOCAL_MCS_FLAGS = -r:System.Xml.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = System.Xml
PROGRAM = genxs.exe
include ../../build/executable.make
diff --git a/mcs/tools/ictool/Makefile b/mcs/tools/ictool/Makefile
index 13ffb114c20..f34409878c3 100644
--- a/mcs/tools/ictool/Makefile
+++ b/mcs/tools/ictool/Makefile
@@ -2,7 +2,8 @@ thisdir = tools/ictool
SUBDIRS =
include ../../build/rules.make
-LOCAL_MCS_FLAGS = -r:System.Xml.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = System.Xml
PROGRAM = ictool.exe
EXTRA_DISTFILES = ictool-config.xml
diff --git a/mcs/tools/ikdasm/Makefile b/mcs/tools/ikdasm/Makefile
index 6a6cb6fb544..1d0a78c83e0 100644
--- a/mcs/tools/ikdasm/Makefile
+++ b/mcs/tools/ikdasm/Makefile
@@ -3,9 +3,9 @@ SUBDIRS =
include ../../build/rules.make
PROGRAM = ikdasm.exe
-
+LIB_REFS = System System.Core System.Security
LOCAL_MCS_FLAGS = \
- -d:NO_SYMBOL_WRITER /r:System.Security.dll /r:System.Core.dll /r:System.dll
+ -d:NO_SYMBOL_WRITER
#EXTRA_DISTFILES = LICENSE
diff --git a/mcs/tools/installutil/Makefile b/mcs/tools/installutil/Makefile
index c545a4630eb..e7f4401169f 100644
--- a/mcs/tools/installutil/Makefile
+++ b/mcs/tools/installutil/Makefile
@@ -2,7 +2,8 @@ thisdir = tools/installutil
SUBDIRS =
include ../../build/rules.make
-LOCAL_MCS_FLAGS = -r:System.Configuration.Install.dll -r:System.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = System.Configuration.Install System
PROGRAM = installutil.exe
diff --git a/mcs/tools/installvst/Makefile b/mcs/tools/installvst/Makefile
index a5479c948dd..3ba67fe0d8f 100644
--- a/mcs/tools/installvst/Makefile
+++ b/mcs/tools/installvst/Makefile
@@ -2,7 +2,8 @@ thisdir = tools/installvst
SUBDIRS =
include ../../build/rules.make
-LOCAL_MCS_FLAGS = -r:System.Xml.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = System.Xml
PROGRAM = installvst.exe
include ../../build/executable.make
diff --git a/mcs/tools/lc/Makefile b/mcs/tools/lc/Makefile
index d77c8ab6f73..905a75a488a 100644
--- a/mcs/tools/lc/Makefile
+++ b/mcs/tools/lc/Makefile
@@ -2,7 +2,8 @@ thisdir = tools/lc
SUBDIRS =
include ../../build/rules.make
-LOCAL_MCS_FLAGS = -r:System.dll -r:System.Core.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = System System.Core
PROGRAM = lc.exe
CLEAN_FILES = lc.exe lc.exe.mdb
diff --git a/mcs/tools/linker-analyzer/Makefile b/mcs/tools/linker-analyzer/Makefile
index e68e7f6c39b..08a3fdc093a 100644
--- a/mcs/tools/linker-analyzer/Makefile
+++ b/mcs/tools/linker-analyzer/Makefile
@@ -4,6 +4,7 @@ include ../../build/rules.make
PROGRAM = linkeranalyzer.exe
-LOCAL_MCS_FLAGS = /r:System.dll /r:System.Xml.dll
+LIB_REFS = System System.Xml
+LOCAL_MCS_FLAGS =
include ../../build/executable.make
diff --git a/mcs/tools/linker/Makefile b/mcs/tools/linker/Makefile
index 63c5eb6adce..3dd8398d2bc 100644
--- a/mcs/tools/linker/Makefile
+++ b/mcs/tools/linker/Makefile
@@ -2,10 +2,6 @@ thisdir = tools/linker
SUBDIRS =
include ../../build/rules.make
-PROGRAM_SNK = ../../class/mono.snk
-
-CECIL = $(topdir)/class/lib/$(PROFILE)/Mono.Cecil.dll
-
RESOURCES = \
Descriptors/mscorlib.xml \
Descriptors/System.xml \
@@ -18,7 +14,8 @@ PROGRAM = monolinker.exe
$(PROGRAM): $(RESOURCES)
-LOCAL_MCS_FLAGS = /r:$(CECIL) /r:System.Xml.dll /r:System.Core.dll /r:System.dll $(RESOURCES:%=-resource:%)
+LIB_REFS = System System.Core System.Xml Mono.Cecil
+LOCAL_MCS_FLAGS = $(RESOURCES:%=-resource:%)
EXTRA_DISTFILES = $(RESOURCES)
diff --git a/mcs/tools/mconfig/Makefile b/mcs/tools/mconfig/Makefile
index f7f8721adc1..92fc95c91f1 100644
--- a/mcs/tools/mconfig/Makefile
+++ b/mcs/tools/mconfig/Makefile
@@ -2,7 +2,8 @@ thisdir = tools/mconfig
SUBDIRS =
include ../../build/rules.make
-LOCAL_MCS_FLAGS = -r:System.Xml.dll -r:System.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = System.Xml System
PROGRAM = mconfig.exe
BUILT_SOURCES=Mono.MonoConfig/consts.cs
diff --git a/mcs/tools/mdbdump/Makefile b/mcs/tools/mdbdump/Makefile
index 9647a44d52f..55d4012a13a 100644
--- a/mcs/tools/mdbdump/Makefile
+++ b/mcs/tools/mdbdump/Makefile
@@ -4,9 +4,7 @@ include ../../build/rules.make
PROGRAM = mdbdump.exe
-LOCAL_MCS_FLAGS = \
- /r:System.Xml.dll \
- /r:Mono.Cecil.dll \
- /r:Mono.CompilerServices.SymbolWriter.dll
+LIB_REFS = Mono.Cecil System.Xml Mono.CompilerServices.SymbolWriter
+LOCAL_MCS_FLAGS =
include ../../build/executable.make
diff --git a/mcs/tools/mdbrebase/Makefile b/mcs/tools/mdbrebase/Makefile
index e0432ef90a7..e0f6fe81956 100644
--- a/mcs/tools/mdbrebase/Makefile
+++ b/mcs/tools/mdbrebase/Makefile
@@ -4,7 +4,7 @@ include ../../build/rules.make
PROGRAM = mdbrebase.exe
-LOCAL_MCS_FLAGS = /r:Mono.CompilerServices.SymbolWriter.dll /r:System.dll
-
+LIB_REFS = System Mono.CompilerServices.SymbolWriter
+LOCAL_MCS_FLAGS =
include ../../build/executable.make
diff --git a/mcs/tools/mdoc/Makefile b/mcs/tools/mdoc/Makefile
index 3fb309b2273..efb76cbf9e0 100644
--- a/mcs/tools/mdoc/Makefile
+++ b/mcs/tools/mdoc/Makefile
@@ -12,16 +12,10 @@ MDOC_COMMON_FLAGS = \
/resource:Resources/msitomsx.xsl,msitomsx.xsl \
/resource:Resources/overview.xsl,overview.xsl \
/resource:Resources/stylesheet.xsl,stylesheet.xsl \
- /r:System.Web.dll \
- /r:System.Xml.Linq.dll \
- /r:ICSharpCode.SharpZipLib.dll \
- /r:Mono.Cecil.dll \
- /r:System.dll \
- /r:System.Xml.dll \
- /r:System.Core.dll
-
-LOCAL_MCS_FLAGS = $(MDOC_COMMON_FLAGS) \
- /r:monodoc.dll
+
+LIB_REFS = monodoc System System.Xml System.Core Mono.Cecil ICSharpCode.SharpZipLib System.Xml.Linq System.Web
+
+LOCAL_MCS_FLAGS = $(MDOC_COMMON_FLAGS)
PROGRAM = mdoc.exe
PROGRAM_DEPS = $(topdir)/class/lib/$(PROFILE)/monodoc.dll
@@ -98,51 +92,51 @@ cleanup:
-rm -f monodocer1.exe*
Test/DocTest-addNonGeneric.dll:
- $(CSCOMPILE) $(TEST_CSCFLAGS) -debug -unsafe -target:library -out:$@ Test/DocTest-addNonGeneric.cs
+ $(CSCOMPILE) $(TEST_CSCFLAGS) -unsafe -target:library -out:$@ Test/DocTest-addNonGeneric.cs
Test/DocTest-addNonGeneric-v2.dll:
- $(CSCOMPILE) $(TEST_CSCFLAGS) -debug -unsafe -target:library -out:$@ Test/DocTest-addNonGeneric.cs /define:V2
+ $(CSCOMPILE) $(TEST_CSCFLAGS) -unsafe -target:library -out:$@ Test/DocTest-addNonGeneric.cs /define:V2
Test/DocTest-DropNS-classic-secondary.dll:
@echo $(value @)
- $(CSCOMPILE) $(TEST_CSCFLAGS) -debug -unsafe -target:library -out:$@ Test/DocTest-DropNS-classic-secondary.cs
+ $(CSCOMPILE) $(TEST_CSCFLAGS) -unsafe -target:library -out:$@ Test/DocTest-DropNS-classic-secondary.cs
Test/DocTest-DropNS-classic.dll:
@echo $(value @)
- $(CSCOMPILE) $(TEST_CSCFLAGS) -debug -unsafe -target:library -out:$@ Test/DocTest-DropNS-classic.cs
+ $(CSCOMPILE) $(TEST_CSCFLAGS) -unsafe -target:library -out:$@ Test/DocTest-DropNS-classic.cs
Test/DocTest-DropNS-unified.dll:
- $(CSCOMPILE) $(TEST_CSCFLAGS) -debug -unsafe -target:library -out:$@ Test/DocTest-DropNS-unified.cs
+ $(CSCOMPILE) $(TEST_CSCFLAGS) -unsafe -target:library -out:$@ Test/DocTest-DropNS-unified.cs
Test/DocTest-DropNS-unified-multitest.dll:
rm -f $@
- $(CSCOMPILE) $(TEST_CSCFLAGS) -debug -unsafe -target:library -out:$@ Test/DocTest-DropNS-unified.cs /define:MULTITEST
+ $(CSCOMPILE) $(TEST_CSCFLAGS) -unsafe -target:library -out:$@ Test/DocTest-DropNS-unified.cs /define:MULTITEST
Test/DocTest-DropNS-classic-multitest.dll:
rm -f $@
- $(CSCOMPILE) $(TEST_CSCFLAGS) -debug -unsafe -target:library -out:$@ Test/DocTest-DropNS-classic.cs /define:MULTITEST
+ $(CSCOMPILE) $(TEST_CSCFLAGS) -unsafe -target:library -out:$@ Test/DocTest-DropNS-classic.cs /define:MULTITEST
Test/DocTest-DropNS-unified-deletetest.dll:
rm -f Test/DocTest-DropNS-unified-deletetest.dll
- $(CSCOMPILE) $(TEST_CSCFLAGS) -debug -unsafe -target:library -out:$@ Test/DocTest-DropNS-unified.cs /define:DELETETEST
+ $(CSCOMPILE) $(TEST_CSCFLAGS) -unsafe -target:library -out:$@ Test/DocTest-DropNS-unified.cs /define:DELETETEST
Test/DocTest-DropNS-unified-deletetest-V2.dll:
rm -f Test/DocTest-DropNS-unified-deletetest.dll
- $(CSCOMPILE) $(TEST_CSCFLAGS) -debug -unsafe -target:library -out:Test/DocTest-DropNS-unified-deletetest.dll Test/DocTest-DropNS-unified.cs /define:DELETETEST,V2
+ $(CSCOMPILE) $(TEST_CSCFLAGS) -unsafe -target:library -out:Test/DocTest-DropNS-unified-deletetest.dll Test/DocTest-DropNS-unified.cs /define:DELETETEST,V2
Test/DocTest-DropNS-classic-deletetest.dll:
rm -f Test/DocTest-DropNS-classic-deletetest.dll
- $(CSCOMPILE) $(TEST_CSCFLAGS) -debug -unsafe -target:library -out:$@ Test/DocTest-DropNS-classic.cs /define:DELETETEST
+ $(CSCOMPILE) $(TEST_CSCFLAGS) -unsafe -target:library -out:$@ Test/DocTest-DropNS-classic.cs /define:DELETETEST
Test/DocTest-DropNS-classic-deletetest-V2.dll:
rm -f Test/DocTest-DropNS-classic-deletetest.dll
- $(CSCOMPILE) $(TEST_CSCFLAGS) -debug -unsafe -target:library -out:Test/DocTest-DropNS-classic-deletetest.dll Test/DocTest-DropNS-classic.cs /define:DELETETEST,V2
+ $(CSCOMPILE) $(TEST_CSCFLAGS) -unsafe -target:library -out:Test/DocTest-DropNS-classic-deletetest.dll Test/DocTest-DropNS-classic.cs /define:DELETETEST,V2
Test/DocTest.dll:
- $(CSCOMPILE) $(TEST_CSCFLAGS) -debug -unsafe -target:library -out:$@ Test/DocTest.cs
+ $(CSCOMPILE) $(TEST_CSCFLAGS) -unsafe -target:library -out:$@ Test/DocTest.cs -r:$(topdir)/class/lib/$(PROFILE)/System.Core.dll -r:$(topdir)/class/lib/$(PROFILE)/Microsoft.CSharp.dll
Test/DocTest-InternalInterface.dll:
- $(CSCOMPILE) $(TEST_CSCFLAGS) -debug -unsafe -target:library -out:$@ Test/DocTest-InternalInterface.cs
+ $(CSCOMPILE) $(TEST_CSCFLAGS) -unsafe -target:library -out:$@ Test/DocTest-InternalInterface.cs
Test/DocTest.dll-v1:
-rm -f Test/DocTest.cs
@@ -158,7 +152,7 @@ Test/DocTest.dll-v2:
$(MAKE) TEST_CSCFLAGS=$(TEST_CSCFLAGS) Test/DocTest.dll
Test/DocTest-enumerations.dll:
- $(CSCOMPILE) $(TEST_CSCFLAGS) -debug -unsafe -target:library -out:$@ Test/DocTest-enumerations.cs
+ $(CSCOMPILE) $(TEST_CSCFLAGS) -unsafe -target:library -out:$@ Test/DocTest-enumerations.cs
check-monodocer-addNonGeneric: $(PROGRAM)
-rm -Rf Test/en.actual
diff --git a/mcs/tools/mkbundle/Makefile b/mcs/tools/mkbundle/Makefile
index 44620aacd1f..867c1d3e2df 100644
--- a/mcs/tools/mkbundle/Makefile
+++ b/mcs/tools/mkbundle/Makefile
@@ -10,7 +10,8 @@ RESOURCE_FILES = $(OTHER_RES)
LOCAL_MCS_FLAGS= $(OTHER_RES:%=-resource:%)
-LOCAL_MCS_FLAGS += -d:STATIC,NO_SYMBOL_WRITER,NO_AUTHENTICODE -r:System.Xml.dll -r:System.dll
+LOCAL_MCS_FLAGS += -d:STATIC,NO_SYMBOL_WRITER,NO_AUTHENTICODE
+LIB_REFS = System.Xml System
EXTRA_DISTFILES = $(RESOURCE_FILES)
diff --git a/mcs/tools/mod/Makefile b/mcs/tools/mod/Makefile
index 90c9afcb026..35133d61dbe 100644
--- a/mcs/tools/mod/Makefile
+++ b/mcs/tools/mod/Makefile
@@ -2,7 +2,8 @@ thisdir = tools/mod
SUBDIRS =
include ../../build/rules.make
-LOCAL_MCS_FLAGS = /r:monodoc.dll
+LIB_REFS = monodoc
+LOCAL_MCS_FLAGS =
PROGRAM = mod.exe
diff --git a/mcs/tools/corcompare/mono-api-html/ApiChange.cs b/mcs/tools/mono-api-html/ApiChange.cs
index 1d902cacfad..1d902cacfad 100644
--- a/mcs/tools/corcompare/mono-api-html/ApiChange.cs
+++ b/mcs/tools/mono-api-html/ApiChange.cs
diff --git a/mcs/tools/corcompare/mono-api-html/ApiDiff.cs b/mcs/tools/mono-api-html/ApiDiff.cs
index 8fe27844852..8fe27844852 100644
--- a/mcs/tools/corcompare/mono-api-html/ApiDiff.cs
+++ b/mcs/tools/mono-api-html/ApiDiff.cs
diff --git a/mcs/tools/corcompare/mono-api-html/AssemblyComparer.cs b/mcs/tools/mono-api-html/AssemblyComparer.cs
index adbd862eb92..adbd862eb92 100644
--- a/mcs/tools/corcompare/mono-api-html/AssemblyComparer.cs
+++ b/mcs/tools/mono-api-html/AssemblyComparer.cs
diff --git a/mcs/tools/corcompare/mono-api-html/ClassComparer.cs b/mcs/tools/mono-api-html/ClassComparer.cs
index a3399fbef04..a3399fbef04 100644
--- a/mcs/tools/corcompare/mono-api-html/ClassComparer.cs
+++ b/mcs/tools/mono-api-html/ClassComparer.cs
diff --git a/mcs/tools/corcompare/mono-api-html/Comparer.cs b/mcs/tools/mono-api-html/Comparer.cs
index 4210b9b95fb..4210b9b95fb 100644
--- a/mcs/tools/corcompare/mono-api-html/Comparer.cs
+++ b/mcs/tools/mono-api-html/Comparer.cs
diff --git a/mcs/tools/corcompare/mono-api-html/ConstructorComparer.cs b/mcs/tools/mono-api-html/ConstructorComparer.cs
index 9bd837e241f..9bd837e241f 100644
--- a/mcs/tools/corcompare/mono-api-html/ConstructorComparer.cs
+++ b/mcs/tools/mono-api-html/ConstructorComparer.cs
diff --git a/mcs/tools/corcompare/mono-api-html/EventComparer.cs b/mcs/tools/mono-api-html/EventComparer.cs
index 693f16f5342..693f16f5342 100644
--- a/mcs/tools/corcompare/mono-api-html/EventComparer.cs
+++ b/mcs/tools/mono-api-html/EventComparer.cs
diff --git a/mcs/tools/corcompare/mono-api-html/FieldComparer.cs b/mcs/tools/mono-api-html/FieldComparer.cs
index a2b0225b448..a2b0225b448 100644
--- a/mcs/tools/corcompare/mono-api-html/FieldComparer.cs
+++ b/mcs/tools/mono-api-html/FieldComparer.cs
diff --git a/mcs/tools/corcompare/mono-api-html/Helpers.cs b/mcs/tools/mono-api-html/Helpers.cs
index 8769785c478..8769785c478 100644
--- a/mcs/tools/corcompare/mono-api-html/Helpers.cs
+++ b/mcs/tools/mono-api-html/Helpers.cs
diff --git a/mcs/tools/corcompare/mono-api-html/InterfaceComparer.cs b/mcs/tools/mono-api-html/InterfaceComparer.cs
index df52f162e49..df52f162e49 100644
--- a/mcs/tools/corcompare/mono-api-html/InterfaceComparer.cs
+++ b/mcs/tools/mono-api-html/InterfaceComparer.cs
diff --git a/mcs/tools/mono-api-html/Makefile b/mcs/tools/mono-api-html/Makefile
new file mode 100644
index 00000000000..e1c55c1f0a5
--- /dev/null
+++ b/mcs/tools/mono-api-html/Makefile
@@ -0,0 +1,10 @@
+thisdir = tools/mono-api-html
+SUBDIRS =
+include ../../build/rules.make
+
+LIB_REFS = Mono.Cecil System.Xml System.Core System System.Xml.Linq
+LOCAL_MCS_FLAGS =
+
+PROGRAM = mono-api-html.exe
+
+include ../../build/executable.make
diff --git a/mcs/tools/corcompare/mono-api-html/MemberComparer.cs b/mcs/tools/mono-api-html/MemberComparer.cs
index d12d86625c2..d12d86625c2 100644
--- a/mcs/tools/corcompare/mono-api-html/MemberComparer.cs
+++ b/mcs/tools/mono-api-html/MemberComparer.cs
diff --git a/mcs/tools/corcompare/mono-api-html/MethodComparer.cs b/mcs/tools/mono-api-html/MethodComparer.cs
index 4c893e757ec..4c893e757ec 100644
--- a/mcs/tools/corcompare/mono-api-html/MethodComparer.cs
+++ b/mcs/tools/mono-api-html/MethodComparer.cs
diff --git a/mcs/tools/corcompare/mono-api-html/NamespaceComparer.cs b/mcs/tools/mono-api-html/NamespaceComparer.cs
index 063e34ecbf7..063e34ecbf7 100644
--- a/mcs/tools/corcompare/mono-api-html/NamespaceComparer.cs
+++ b/mcs/tools/mono-api-html/NamespaceComparer.cs
diff --git a/mcs/tools/corcompare/mono-api-html/PropertyComparer.cs b/mcs/tools/mono-api-html/PropertyComparer.cs
index f51dd231bb9..f51dd231bb9 100644
--- a/mcs/tools/corcompare/mono-api-html/PropertyComparer.cs
+++ b/mcs/tools/mono-api-html/PropertyComparer.cs
diff --git a/mcs/tools/corcompare/mono-api-html/mono-api-html.csproj b/mcs/tools/mono-api-html/mono-api-html.csproj
index 6ac0f241ade..6ac0f241ade 100644
--- a/mcs/tools/corcompare/mono-api-html/mono-api-html.csproj
+++ b/mcs/tools/mono-api-html/mono-api-html.csproj
diff --git a/mcs/tools/mono-api-html/mono-api-html.exe.sources b/mcs/tools/mono-api-html/mono-api-html.exe.sources
new file mode 100644
index 00000000000..69a26798dbf
--- /dev/null
+++ b/mcs/tools/mono-api-html/mono-api-html.exe.sources
@@ -0,0 +1,15 @@
+ApiChange.cs
+ApiDiff.cs
+AssemblyComparer.cs
+ClassComparer.cs
+Comparer.cs
+ConstructorComparer.cs
+EventComparer.cs
+FieldComparer.cs
+Helpers.cs
+InterfaceComparer.cs
+MemberComparer.cs
+MethodComparer.cs
+NamespaceComparer.cs
+PropertyComparer.cs
+../../class/Mono.Options/Mono.Options/Options.cs
diff --git a/mcs/tools/mono-configuration-crypto/cli/Makefile b/mcs/tools/mono-configuration-crypto/cli/Makefile
index 36d7feb5946..fe3b52f8d21 100644
--- a/mcs/tools/mono-configuration-crypto/cli/Makefile
+++ b/mcs/tools/mono-configuration-crypto/cli/Makefile
@@ -2,11 +2,8 @@ thisdir = tools/mono-configuration-crypto/cli
SUBDIRS =
include ../../../build/rules.make
-LOCAL_MCS_FLAGS = -r:Mono.Security.dll \
- -r:System.Security.dll \
- -r:System.Configuration.dll \
- -r:System.dll \
- -r:$(topdir)/class/lib/$(PROFILE)/Mono.Configuration.Crypto.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = Mono.Security System.Security System.Configuration System Mono.Configuration.Crypto
PROGRAM = mono-configuration-crypto.exe
PROGRAM_INSTALL_DIR = $(mono_libdir)/mono/mono-configuration-crypto/$(FRAMEWORK_VERSION)
diff --git a/mcs/tools/mono-configuration-crypto/lib/Makefile b/mcs/tools/mono-configuration-crypto/lib/Makefile
index 06351749f74..d06b52ae235 100644
--- a/mcs/tools/mono-configuration-crypto/lib/Makefile
+++ b/mcs/tools/mono-configuration-crypto/lib/Makefile
@@ -2,7 +2,8 @@ thisdir = tools/mono-configuration-crypto/lib
SUBDIRS =
include ../../../build/rules.make
-LOCAL_MCS_FLAGS = -r:System.dll -r:Mono.Security.dll -r:System.Security.dll -r:System.Configuration.dll -r:System.Xml.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = System Mono.Security System.Security System.Configuration System.Xml
LIBRARY = Mono.Configuration.Crypto.dll
LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/mono-configuration-crypto/$(FRAMEWORK_VERSION)
diff --git a/mcs/tools/mono-service/Makefile b/mcs/tools/mono-service/Makefile
index 7e8331eb46a..84286e7f95f 100644
--- a/mcs/tools/mono-service/Makefile
+++ b/mcs/tools/mono-service/Makefile
@@ -4,9 +4,12 @@ include ../../build/rules.make
PROGRAM = mono-service.exe
+PROGRAM_SNK = ../../class/mono.snk
+
include ../../build/executable.make
-LOCAL_MCS_FLAGS = -r:System.ServiceProcess.dll -r:Mono.Posix.dll -r:System.dll -unsafe
+LOCAL_MCS_FLAGS = -unsafe -publicsign
+LIB_REFS = System.ServiceProcess Mono.Posix System
# Copied from library.make
diff --git a/mcs/tools/mono-shlib-cop/Makefile b/mcs/tools/mono-shlib-cop/Makefile
index e4e4b557eb4..2bfc65599d9 100644
--- a/mcs/tools/mono-shlib-cop/Makefile
+++ b/mcs/tools/mono-shlib-cop/Makefile
@@ -2,7 +2,8 @@ thisdir = tools/mono-shlib-cop
SUBDIRS =
include ../../build/rules.make
-LOCAL_MCS_FLAGS = -r:Mono.Posix.dll -r:System.dll -r:System.Xml.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = Mono.Posix System System.Xml
PROGRAM = mono-shlib-cop.exe
diff --git a/mcs/tools/mono-symbolicate/Makefile b/mcs/tools/mono-symbolicate/Makefile
index 35cdfd88a39..1a621f6f825 100644
--- a/mcs/tools/mono-symbolicate/Makefile
+++ b/mcs/tools/mono-symbolicate/Makefile
@@ -4,12 +4,9 @@ include ../../build/rules.make
PROGRAM = mono-symbolicate.exe
-LOCAL_MCS_FLAGS = \
- /r:Mono.Cecil.dll \
- /r:Mono.CompilerServices.SymbolWriter.dll \
- /r:System.Xml.dll \
- /r:System.Core.dll \
- /r:System.dll
+LOCAL_MCS_FLAGS =
+
+LIB_REFS = Mono.Cecil Mono.CompilerServices.SymbolWriter System.Xml System.Core System
include ../../build/executable.make
@@ -36,10 +33,10 @@ CHECK_DIFF = @\
exit 1; \
fi
-BUILD_TEST_EXE = @\
+BUILD_TEST_EXE = \
rm -rf $(OUT_DIR); \
mkdir -p $(OUT_DIR); \
- $(MCS) -debug $(TEST_CS) -out:$(TEST_EXE)
+ $(CSCOMPILE) $(TEST_CS) -out:$(TEST_EXE)
check: test-local
diff --git a/mcs/tools/mono-xmltool/Makefile b/mcs/tools/mono-xmltool/Makefile
index fc39f8298ab..7439a2eb9dd 100644
--- a/mcs/tools/mono-xmltool/Makefile
+++ b/mcs/tools/mono-xmltool/Makefile
@@ -2,7 +2,8 @@ thisdir = tools/mono-xmltool
SUBDIRS =
include ../../build/rules.make
-LOCAL_MCS_FLAGS = -r:System.Xml.dll -r:Commons.Xml.Relaxng.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = System.Xml Commons.Xml.Relaxng
PROGRAM = mono-xmltool.exe
include ../../build/executable.make
diff --git a/mcs/tools/mono-xsd/Makefile b/mcs/tools/mono-xsd/Makefile
index 85a08599fa7..d9e77ac8251 100644
--- a/mcs/tools/mono-xsd/Makefile
+++ b/mcs/tools/mono-xsd/Makefile
@@ -2,7 +2,8 @@ thisdir = tools/mono-xsd
SUBDIRS =
include ../../build/rules.make
-LOCAL_MCS_FLAGS = -r:System.Xml.dll -r:System.Data.dll -r:System.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = System.Xml System.Data System
PROGRAM = xsd.exe
include ../../build/executable.make
diff --git a/mcs/tools/monop/Makefile b/mcs/tools/monop/Makefile
index 28012279369..4e84d9916fa 100644
--- a/mcs/tools/monop/Makefile
+++ b/mcs/tools/monop/Makefile
@@ -3,7 +3,8 @@ SUBDIRS =
include ../../build/rules.make
PROGRAM = monop.exe
-LOCAL_MCS_FLAGS += -d:NO_AUTHENTICODE,STATIC,NO_SYMBOL_WRITER -r:System.dll
+LOCAL_MCS_FLAGS += -d:NO_AUTHENTICODE,STATIC,NO_SYMBOL_WRITER
+LIB_REFS = System
CLEAN_FILES = monop.exe monop2.exe *.mdb
diff --git a/mcs/tools/msbuild/Makefile b/mcs/tools/msbuild/Makefile
index 61339b1a5cc..6e78792b586 100644
--- a/mcs/tools/msbuild/Makefile
+++ b/mcs/tools/msbuild/Makefile
@@ -3,8 +3,8 @@ SUBDIRS =
include ../../build/rules.make
NO_TESTS = yes
-BUILD_FRAMEWORK = Microsoft.Build.Framework.dll
-BUILD_NEW_ENGINE = Microsoft.Build.dll
+BUILD_FRAMEWORK = Microsoft.Build.Framework
+BUILD_NEW_ENGINE = Microsoft.Build
INSTALL_FRAMEWORK_VERSION = $(FRAMEWORK_VERSION)
include ../xbuild/xbuild.make
@@ -16,13 +16,12 @@ else
ifeq (4, $(FRAMEWORK_VERSION_MAJOR))
NAME_SUFFIX = .v4.0
ASSEMBLY_VERSION = 4.0.0.0
-BUILD_FRAMEWORK := $(topdir)/class/lib/$(PROFILE)/$(BUILD_FRAMEWORK)
-BUILD_NEW_ENGINE := $(topdir)/class/lib/$(PROFILE)/$(BUILD_NEW_ENGINE)
INSTALL_FRAMEWORK_VERSION = 4.0
endif
endif
-LOCAL_MCS_FLAGS = -r:$(BUILD_FRAMEWORK) -r:$(BUILD_NEW_ENGINE)
+LOCAL_MCS_FLAGS =
+LIB_REFS = $(BUILD_FRAMEWORK) $(BUILD_NEW_ENGINE)
PROGRAM = msbuild.exe
include ../../build/executable.make
diff --git a/mcs/tools/nunit-lite/NUnitLite/Makefile b/mcs/tools/nunit-lite/NUnitLite/Makefile
index 9dd062fe9c1..1d448c2915a 100644
--- a/mcs/tools/nunit-lite/NUnitLite/Makefile
+++ b/mcs/tools/nunit-lite/NUnitLite/Makefile
@@ -5,7 +5,8 @@ include ../../../build/rules.make
LIBRARY = nunitlite.dll
LIBRARY_SNK = ../../../../external/nunit-lite/NUnitLite-1.0.0/src/framework/nunit.snk
-LOCAL_MCS_FLAGS= /target:library /define:"__MOBILE__;TRACE;DEBUG;NET_4_0;CLR_4_0,NUNITLITE" /nostdlib -r:System.dll -r:System.Xml.dll -r:System.Core.dll -r:mscorlib.dll /warn:4 /noconfig /debug:full /debug+ /keyfile:$(LIBRARY_SNK) /optimize
+LOCAL_MCS_FLAGS= /target:library /define:"__MOBILE__;TRACE;DEBUG;NET_4_0;CLR_4_0,NUNITLITE" /warn:4 /keyfile:$(LIBRARY_SNK)
+LIB_REFS = System System.Xml System.Core
NO_TEST = yes
diff --git a/mcs/tools/nunit-lite/nunit-lite-console/Makefile b/mcs/tools/nunit-lite/nunit-lite-console/Makefile
index 920f74d29a5..c3697e420fc 100644
--- a/mcs/tools/nunit-lite/nunit-lite-console/Makefile
+++ b/mcs/tools/nunit-lite/nunit-lite-console/Makefile
@@ -3,7 +3,8 @@ SUBDIRS =
include ../../../build/rules.make
PROGRAM = nunit-lite-console.exe
-LOCAL_MCS_FLAGS = /r:nunitlite.dll
+LIB_REFS = nunitlite
+LOCAL_MCS_FLAGS =
include ../../../build/executable.make
diff --git a/mcs/tools/nunitreport/Makefile b/mcs/tools/nunitreport/Makefile
index 057ddabea69..3d3f647bc3c 100644
--- a/mcs/tools/nunitreport/Makefile
+++ b/mcs/tools/nunitreport/Makefile
@@ -3,7 +3,8 @@ SUBDIRS =
NO_INSTALL = 1
include ../../build/rules.make
-LOCAL_MCS_FLAGS = -r:System.Xml.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = System.Xml
EXTRA_DISTFILES = \
Media/*.png \
diff --git a/mcs/tools/pdb2mdb/Makefile b/mcs/tools/pdb2mdb/Makefile
index 8de09cc43e9..0d2f377310c 100644
--- a/mcs/tools/pdb2mdb/Makefile
+++ b/mcs/tools/pdb2mdb/Makefile
@@ -4,10 +4,8 @@ include ../../build/rules.make
PROGRAM = pdb2mdb.exe
-LOCAL_MCS_FLAGS = \
- /r:Mono.Cecil.dll \
- /r:Mono.CompilerServices.SymbolWriter.dll \
- /r:System.Core.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = Mono.Cecil Mono.CompilerServices.SymbolWriter System.Core
EXTRA_DISTFILES = LICENSE
diff --git a/mcs/tools/resgen/Makefile b/mcs/tools/resgen/Makefile
index 117f99231d7..2ccbf5869c7 100644
--- a/mcs/tools/resgen/Makefile
+++ b/mcs/tools/resgen/Makefile
@@ -6,7 +6,7 @@ PROGRAM = resgen.exe
CLEAN_FILES = resgen.exe
-LOCAL_MCS_FLAGS = -r:System.dll -r:System.Xml.dll -r:System.Core.dll
+LIB_REFS = System System.Xml System.Core
INSTALL_PROFILE := $(filter $(DEFAULT_PROFILE), $(PROFILE))
ifndef INSTALL_PROFILE
diff --git a/mcs/tools/security/Makefile b/mcs/tools/security/Makefile
index d75599dcee5..e4bfbb4d315 100644
--- a/mcs/tools/security/Makefile
+++ b/mcs/tools/security/Makefile
@@ -3,7 +3,8 @@ SUBDIRS =
DIST_ONLY_SUBDIRS = certview
include ../../build/rules.make
-LOCAL_MCS_FLAGS = /lib:$(topdir)/class/lib/$(PROFILE) -r:Mono.Security.dll -r:System.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = Mono.Security System
SECURITY_PROGRAMS = secutil.exe cert2spc.exe sn.exe makecert.exe chktrust.exe crlupdate.exe \
signcode.exe setreg.exe certmgr.exe caspol.exe permview.exe mozroots.exe cert-sync.exe
@@ -58,10 +59,10 @@ clean-local:
dist-local: dist-default
sn.exe $(topdir)/class/lib/$(PROFILE)/sn.exe: $(SN_SOURCES)
- $(CSCOMPILE) /out:$@ $(SN_SOURCES)
+ $(CSCOMPILE) -r:$(topdir)/class/lib/$(PROFILE)/Mono.Security.dll /out:$@ $(SN_SOURCES)
permview.exe: permview.cs
- $(CSCOMPILE) $^ $(HELPER_SOURCES) -r:Mono.Cecil.dll
+ $(CSCOMPILE) $^ $(HELPER_SOURCES) -r:$(topdir)/class/lib/$(PROFILE)/Mono.Cecil.dll
%.exe: %.cs $(HELPER_SOURCES)
- $(CSCOMPILE) $^
+ $(CSCOMPILE) -r:$(topdir)/class/lib/$(PROFILE)/Mono.Security.dll -r:$(topdir)/class/lib/$(PROFILE)/System.dll $^
diff --git a/mcs/tools/security/certview/Makefile b/mcs/tools/security/certview/Makefile
index 377d396f015..aaa92049f4b 100644
--- a/mcs/tools/security/certview/Makefile
+++ b/mcs/tools/security/certview/Makefile
@@ -3,7 +3,8 @@ SUBDIRS =
include ../../../build/rules.make
RESGEN = resgen
-LOCAL_MCS_FLAGS = /lib:$(topdir)/class/lib /r:Mono.Security.dll /r:System.Xml.dll /win32icon:mono.ico
+LIB_REFS = Mono.Security System.Xml
+LOCAL_MCS_FLAGS = /win32icon:mono.ico
# SWF isn't quite good enough to build this yet.
diff --git a/mcs/tools/sgen/Makefile b/mcs/tools/sgen/Makefile
index bf5bd1c904e..e7750a2c11b 100644
--- a/mcs/tools/sgen/Makefile
+++ b/mcs/tools/sgen/Makefile
@@ -2,7 +2,8 @@ thisdir = tools/sgen
SUBDIRS =
include ../../build/rules.make
-LOCAL_MCS_FLAGS = -r:System.Xml.dll -r:System.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = System.Xml System
PROGRAM = sgen.exe
include ../../build/executable.make
diff --git a/mcs/tools/soapsuds/Makefile b/mcs/tools/soapsuds/Makefile
index 2fccb32ad59..1fc6cb2763e 100644
--- a/mcs/tools/soapsuds/Makefile
+++ b/mcs/tools/soapsuds/Makefile
@@ -2,7 +2,8 @@ thisdir = tools/soapsuds
SUBDIRS =
include ../../build/rules.make
-LOCAL_MCS_FLAGS = -r:System.Runtime.Remoting.dll -r:System.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = System.Runtime.Remoting System
PROGRAM = soapsuds.exe
include ../../build/executable.make
diff --git a/mcs/tools/sqlmetal/Makefile b/mcs/tools/sqlmetal/Makefile
index 7bd68482312..ee0b6494796 100644
--- a/mcs/tools/sqlmetal/Makefile
+++ b/mcs/tools/sqlmetal/Makefile
@@ -11,13 +11,10 @@ LOCAL_MCS_FLAGS = \
-resource:$(dbmetal_src)/Language/EnglishWords.txt,$(ns).EnglishWords.txt \
-resource:$(dbmetal_src)/Language/FrenchWords.txt,$(ns).FrenchWords.txt \
-resource:$(dbmetal_src)/Language/GermanWords.txt,$(ns).GermanWords.txt \
- -r:System.Configuration.dll \
- -r:System.Core.dll \
- -r:System.Data.dll \
- -r:System.Data.Linq.dll \
- -r:System.Xml.dll \
- -r:System.dll
+ -publicsign
+LIB_REFS = System.Configuration System.Core System.Data System.Data.Linq System.Xml System
+
SQLMETAL_RESOURCES = \
$(dbmetal_src)/Language/EnglishWords.txt \
$(dbmetal_src)/Language/FrenchWords.txt \
diff --git a/mcs/tools/sqlsharp/Makefile b/mcs/tools/sqlsharp/Makefile
index 042e97b92a3..88ad1f8d9b5 100644
--- a/mcs/tools/sqlsharp/Makefile
+++ b/mcs/tools/sqlsharp/Makefile
@@ -2,7 +2,8 @@ thisdir = tools/SqlSharp
SUBDIRS =
include ../../build/rules.make
-LOCAL_MCS_FLAGS = -r:System.dll -r:System.Xml.dll -r:System.Data.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = System System.Xml System.Data
PROGRAM = sqlsharp.exe
EXTRA_DISTFILES = README
diff --git a/mcs/tools/svcutil/Makefile b/mcs/tools/svcutil/Makefile
index cf174fe3979..b194a5b144d 100644
--- a/mcs/tools/svcutil/Makefile
+++ b/mcs/tools/svcutil/Makefile
@@ -2,14 +2,8 @@ thisdir = tools/svcutil
SUBDIRS =
include ../../build/rules.make
-LOCAL_MCS_FLAGS = \
- -r:System.Core.dll \
- -r:System.Runtime.Serialization.dll \
- -r:System.ServiceModel.dll \
- -r:System.Web.Services.dll \
- -r:System.Configuration.dll \
- -r:System.dll \
- -r:System.Xml.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = System.Core System.Runtime.Serialization System.ServiceModel System.Web.Services System.Configuration System System.Xml
PROGRAM = svcutil.exe
diff --git a/mcs/tools/tuner/Makefile b/mcs/tools/tuner/Makefile
index bfc24a16c45..c364223deb0 100644
--- a/mcs/tools/tuner/Makefile
+++ b/mcs/tools/tuner/Makefile
@@ -3,10 +3,8 @@ SUBDIRS =
DEP_DIRS = linker
include ../../build/rules.make
-CECIL = $(topdir)/class/lib/$(PROFILE)/Mono.Cecil.dll
-LINKER = $(topdir)/class/lib/$(PROFILE)/monolinker.exe
-
-LOCAL_MCS_FLAGS = -r:System.dll -r:System.Core.dll -r:System.Xml.dll -r:$(LINKER) -r:$(CECIL)
+LOCAL_MCS_FLAGS = -r:$(topdir)/class/lib/$(PROFILE)/monolinker.exe
+LIB_REFS = System System.Core System.Xml Mono.Cecil
LIBRARY = Mono.Tuner.dll
diff --git a/mcs/tools/wsdl/Makefile b/mcs/tools/wsdl/Makefile
index 786c81885f0..293cf9d2811 100644
--- a/mcs/tools/wsdl/Makefile
+++ b/mcs/tools/wsdl/Makefile
@@ -2,7 +2,8 @@ thisdir = tools/wsdl
SUBDIRS =
include ../../build/rules.make
-LOCAL_MCS_FLAGS = -r:System.Xml.dll -r:System.Web.Services.dll -r:System.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = System.Xml System.Web.Services System
PROGRAM = wsdl.exe
diff --git a/mcs/tools/xbuild/Makefile b/mcs/tools/xbuild/Makefile
index 0ca5126a6d4..70457756436 100644
--- a/mcs/tools/xbuild/Makefile
+++ b/mcs/tools/xbuild/Makefile
@@ -5,7 +5,8 @@ NO_TESTS = yes
include xbuild.make
-LOCAL_MCS_FLAGS = -r:$(XBUILD_FRAMEWORK) -r:$(XBUILD_UTILITIES) -r:$(XBUILD_ENGINE) -r:$(XBUILD_MSTASKS) -r:System.dll -r:System.Core.dll
+LOCAL_MCS_FLAGS =
+LIB_REFS = $(XBUILD_FRAMEWORK) $(XBUILD_UTILITIES) $(XBUILD_ENGINE) $(XBUILD_MSTASKS) $(PARENT_PROFILE)System $(PARENT_PROFILE)System.Core
PROGRAM = xbuild.exe
include ../../build/executable.make
diff --git a/mcs/tools/xbuild/xbuild.make b/mcs/tools/xbuild/xbuild.make
index 7247c7f8b0d..cda9d9b0e61 100644
--- a/mcs/tools/xbuild/xbuild.make
+++ b/mcs/tools/xbuild/xbuild.make
@@ -6,13 +6,13 @@ ifeq (14.0, $(XBUILD_VERSION))
NAME_SUFFIX = .Core
endif
-XBUILD_FRAMEWORK := $(topdir)/class/lib/$(PROFILE)/Microsoft.Build.Framework.dll
-XBUILD_ENGINE := $(topdir)/class/lib/$(PROFILE)/Microsoft.Build.Engine.dll
-XBUILD_UTILITIES := $(topdir)/class/lib/$(PROFILE)/Microsoft.Build.Utilities$(NAME_SUFFIX).dll
-XBUILD_TASKS := $(topdir)/class/lib/$(PROFILE)/Mono.XBuild.Tasks.dll
-XBUILD_MSTASKS := $(topdir)/class/lib/$(PROFILE)/Microsoft.Build.Tasks$(NAME_SUFFIX).dll
+XBUILD_FRAMEWORK := Microsoft.Build.Framework
+XBUILD_ENGINE := Microsoft.Build.Engine
+XBUILD_UTILITIES := Microsoft.Build.Utilities$(NAME_SUFFIX)
+XBUILD_TASKS := Mono.XBuild.Tasks
+XBUILD_MSTASKS := Microsoft.Build.Tasks$(NAME_SUFFIX)
ifeq (14.0, $(XBUILD_VERSION))
-XBUILD_MSTASKS := $(topdir)/class/lib/$(PROFILE)/Microsoft.Build.Tasks.Core.dll
+XBUILD_MSTASKS := Microsoft.Build.Tasks.Core
endif
XBUILD_ASSEMBLY_VERSION = $(XBUILD_VERSION).0.0
diff --git a/mono/mini/Makefile.am.in b/mono/mini/Makefile.am.in
index 8fc453350cd..c40dc485016 100755
--- a/mono/mini/Makefile.am.in
+++ b/mono/mini/Makefile.am.in
@@ -48,7 +48,7 @@ RUNTIME_EXECUTABLE = $(if $(BOEHM),$(top_builddir)/mono/mini/mono-boehm,$(top_bu
MINI_RUNTIME = MONO_PATH=$(CLASS) $(RUNTIME_EXECUTABLE)
RUNTIME_AOTCHECK = MONO_PATH="$(CLASS)$(PLATFORM_PATH_SEPARATOR)." $(RUNTIME_EXECUTABLE)
-MCS = $(MINI_RUNTIME) $(mcs_topdir)/class/lib/build/mcs.exe -unsafe -nowarn:0162
+MCS = CSC_SDK_PATH_DISABLED= $(MINI_RUNTIME) $(CSC) -unsafe -nowarn:0162 -nologo -noconfig -r:$(CLASS)/mscorlib.dll -r:$(CLASS)/System.dll
ILASM = $(MINI_RUNTIME) $(CLASS)/ilasm.exe
AM_CFLAGS = \
@@ -602,13 +602,13 @@ libmonoinclude_HEADERS = jit.h
CSFLAGS = -unsafe -nowarn:0219,0169,0414,0649
basic-simd.exe: basic-simd.cs TestDriver.dll
- $(MCS) -out:$@ $(CSFLAGS) $< -r:TestDriver.dll -r:Mono.Simd.dll
+ $(MCS) -out:$@ $(CSFLAGS) $< -r:TestDriver.dll -r:$(CLASS)/Mono.Simd.dll
nacl.exe: nacl.cs TestDriver.dll
- $(MCS) -out:$@ $(CSFLAGS) $< -r:TestDriver.dll -r:Mono.Simd.dll
+ $(MCS) -out:$@ $(CSFLAGS) $< -r:TestDriver.dll -r:$(CLASS)/Mono.Simd.dll
generics.exe: generics.cs TestDriver.dll generics-variant-types.dll
- $(MCS) -out:$@ $(CSFLAGS) $< -r:TestDriver.dll -r:generics-variant-types.dll
+ $(MCS) -out:$@ $(CSFLAGS) $< -r:TestDriver.dll -r:generics-variant-types.dll -r:$(CLASS)/System.Core.dll
%.exe: %.cs TestDriver.dll
$(MCS) -out:$@ $(CSFLAGS) $< -r:TestDriver.dll