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