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