Merge pull request #4503 from BrzVlad/fix-appdomain-unload
[mono.git] / mcs / class / System / Makefile
1 thisdir = class/System
2 SUBDIRS =
3 include ../../build/rules.make
4 export __SECURITY_BOOTSTRAP_DB=$(topdir)/class/lib/$(PROFILE)
5
6 LIBRARY = System.dll
7
8 ifneq (2.1, $(FRAMEWORK_VERSION))
9 RESOURCE_FILES = \
10         resources/Asterisk.wav  \
11         resources/Beep.wav      \
12         resources/Exclamation.wav       \
13         resources/Hand.wav      \
14         resources/Question.wav
15 endif
16
17 RESX_RESOURCE_STRING = \
18         ../../../external/corefx/src/System.Collections.Concurrent/src/Resources/Strings.resx \
19         ../../../external/corefx/src/System.Collections/src/Resources/Strings.resx
20
21 TEST_RESOURCES = \
22         Test/System/test-uri-props.txt \
23         Test/System/test-uri-props-manual.txt \
24         Test/System/test-uri-relative-props.txt
25
26 LIB_MCS_FLAGS = -d:CONFIGURATION_2_0 $(REFERENCE_SOURCES_FLAGS) -unsafe $(RESOURCE_FILES:%=-resource:%) -nowarn:436
27
28 ifndef NO_MONO_SECURITY
29 MONO_SECURITY=Mono.Security
30 MONO_SECURITY_REF=MonoSecurity=Mono.Security
31 MONO_SECURITY_DLL=$(the_libdir_base)Mono.Security.dll
32 EXTERN_ALIAS_FLAGS = -d:MONO_SECURITY_ALIAS
33 else
34 LIB_MCS_FLAGS += -d:INSIDE_SYSTEM
35 endif
36
37 ifndef MOBILE_PROFILE
38 LIB_MCS_FLAGS += -d:CODEDOM
39 TEST_LIB_REFS = $(MONO_SECURITY) System.Data System.Xml System.Core System.Configuration
40
41 ifndef NO_SYSTEM_DRAWING_DEPENDENCY
42 TEST_LIB_REFS += System.Drawing
43 endif
44
45 else
46 LIB_MCS_FLAGS += -nowarn:618
47 TEST_LIB_REFS = $(MONO_SECURITY) System.Data System.Xml System.Core
48 endif
49
50 TEST_MCS_FLAGS = -nowarn:618,672,219,67,169,612 \
51         $(foreach f, $(TEST_RESOURCES), -resource:$(f),$(notdir $(f)))
52
53 TEST_NUNITLITE_APP_CONFIG_GLOBAL=Test/test-config-file
54
55 REFERENCE_SOURCES_FLAGS = -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX
56 ifndef NO_PROCESS_START
57 REFERENCE_SOURCES_FLAGS += -d:MONO_FEATURE_PROCESS_START
58 TEST_MCS_FLAGS += -d:MONO_FEATURE_PROCESS_START
59 endif
60
61 ifdef MONO_FEATURE_APPLETLS
62 LIB_MCS_FLAGS += -d:MONO_FEATURE_APPLETLS
63 endif
64
65 ifdef ONLY_APPLETLS
66 LIB_MCS_FLAGS += -d:ONLY_APPLETLS
67 endif
68
69 ifndef PROFILE_DISABLE_BTLS
70 ifdef HAVE_BTLS
71
72 LIB_MCS_FLAGS += -d:MONO_FEATURE_BTLS
73
74 endif
75 endif
76
77 ifndef NO_THREAD_ABORT
78 REFERENCE_SOURCES_FLAGS += -d:MONO_FEATURE_THREAD_ABORT
79 TEST_MCS_FLAGS += -d:MONO_FEATURE_THREAD_ABORT
80 endif
81
82 ifndef NO_THREAD_SUSPEND_RESUME
83 REFERENCE_SOURCES_FLAGS += -d:MONO_FEATURE_THREAD_SUSPEND_RESUME
84 TEST_MCS_FLAGS += -d:MONO_FEATURE_THREAD_SUSPEND_RESUME
85 endif
86
87 ifndef NO_MULTIPLE_APPDOMAINS
88 REFERENCE_SOURCES_FLAGS += -d:MONO_FEATURE_MULTIPLE_APPDOMAINS
89 TEST_MCS_FLAGS += -d:MONO_FEATURE_MULTIPLE_APPDOMAINS
90 endif
91
92 TXT_RESOURCE_STRINGS = ../referencesource/System/System.txt
93
94 #
95 # Flags used to build the secxml version of System.
96 #
97 ifeq (secxml/, $(intermediate))
98 LOCAL_MCS_FLAGS =
99 LIB_REFS += bare/System.Xml $(MONO_SECURITY_REF)
100 LIB_MCS_FLAGS += -d:SECURITY_DEP -d:XML_DEP $(EXTERN_ALIAS_FLAGS)
101 endif
102
103 #
104 # Flags used to build the final version of System (when intermediate is not defined)
105 #
106 ifndef intermediate
107 LIB_REFS += System.Xml $(MONO_SECURITY_REF)
108 LIB_MCS_FLAGS += -d:SECURITY_DEP -d:XML_DEP $(EXTERN_ALIAS_FLAGS)
109
110 ifndef MOBILE_PROFILE
111 LIB_REFS += System.Configuration
112 LIB_MCS_FLAGS += -d:CONFIGURATION_DEP
113 endif
114
115 endif
116
117 EXTRA_DISTFILES = \
118         common.sources                                  \
119         Test/test-config-file                           \
120         Test/System.Security.Cryptography.X509Certificates/pkits/Makefile       \
121         Test/System.Security.Cryptography.X509Certificates/pkits/README         \
122         Test/System.Security.Cryptography.X509Certificates/pkits/x509build.cs   \
123         $(RESOURCE_FILES)                               \
124         $(TEST_RESOURCES)
125
126 include ../../build/library.make
127
128 system_library_deps := \
129         $(secxml_libdir)/System.dll             \
130         $(the_libdir_base)System.Xml.dll        \
131         $(MONO_SECURITY_DLL)                            \
132         $(bare_libdir)/System.dll
133
134 ifndef MOBILE_PROFILE
135 system_library_deps += $(the_libdir_base)System.Configuration.dll       
136 endif
137
138 artifacts = $(system_library_deps)                      \
139         $(bare_libdir)/System.Xml.dll                   \
140         $(MONO_SECURITY_DLL)                            \
141         $(the_libdir_base)System.Configuration.dll
142
143 .NOTPARALLEL: $(system_library_deps)
144
145 $(the_libdir_base)System.dll: $(system_library_deps) ../Mono.Security/Makefile
146
147 ifeq (bare/,$(intermediate))
148 build-bare:
149 else
150 $(bare_libdir)/System.dll:
151         $(MAKE) intermediate=bare/ $(bare_libdir)/System.dll
152 endif
153
154 ifneq (secxml/,$(intermediate))
155 $(secxml_libdir)/System.dll: $(bare_libdir)/System.dll $(bare_libdir)/System.Xml.dll $(MONO_SECURITY_DLL) $(bare_libdir)/System.dll
156         $(MAKE) intermediate=secxml/ $(secxml_libdir)/System.dll
157 else
158 build-sec:
159 endif
160
161 $(the_libdir_base)System.Xml.dll:
162         (cd ../System.XML; $(MAKE) $@)
163
164 $(bare_libdir)/System.Xml.dll:
165         (cd ../System.XML; $(MAKE) $@)
166
167 $(the_libdir_base)Mono.Security.dll: ../Mono.Security/Makefile
168         (cd ../Mono.Security; $(MAKE))
169
170 $(the_libdir_base)System.Configuration.dll:
171         (cd ../System.Configuration; $(MAKE))
172
173 $(build_lib): $(CYCLIC_DEP_FILES)
174
175 $(test_lib): $(TEST_RESOURCES)
176
177 CLEAN_FILES = $(test_lib).config $(bare_libdir)/System.dll $(secxml_libdir)/System.dll $(bare_libdir)/System.dll.mdb $(secxml_libdir)/System.dll.mdb
178
179 # Helper target to run the perl regex test suite
180 regex-check:
181         $(MAKE) check FIXTURE=System.Text.RegularExpressions.PerlTest
182
183 #Debuging target
184 fresh: clean
185         rm -rf ../../class/lib/$(PROFILE)/bare ../../class/lib/$(PROFILE)/bare/ $(system_library_deps)
186
187 ifndef intermediate
188 ifneq ($(PROFILE),basic)
189 csproj-local:
190         $(MAKE) csproj-local intermediate=bare/
191         $(MAKE) csproj-local intermediate=secxml/
192 endif
193 endif