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