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