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