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