Merge pull request #1612 from esdrubal/socketsh
[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 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 (monodroid, $(PROFILE))
39 LIB_MCS_FLAGS += -d:SECURITY_DEP
40 endif
41 ifndef PROFILE_ANY_MOBILE
42 FINAL_MCS_FLAGS = -r:System.Configuration.dll -d:CONFIGURATION_DEP
43 endif
44
45 #
46 # Flags used to build the secxml version of System.
47 #
48 ifeq (secxml/, $(intermediate))
49 LOCAL_MCS_FLAGS = -lib:$(bare_libdir) 
50 LIB_REFS += System.Xml MonoSecurity=Mono.Security
51 LIB_MCS_FLAGS += -d:SECURITY_DEP -d:XML_DEP -r:PrebuiltSystem=$(bare_libdir)/System.dll
52 endif
53
54 #
55 # Flags used to build the final version of System (when intermediate is not defined)
56 #
57 ifndef intermediate
58 LIB_REFS += System.Xml MonoSecurity=Mono.Security
59 LIB_MCS_FLAGS += -d:SECURITY_DEP -d:XML_DEP -r:PrebuiltSystem=$(secxml_libdir)/System.dll $(FINAL_MCS_FLAGS)
60 endif
61
62 EXTRA_DISTFILES = \
63         Test/test-config-file                           \
64         Test/test-config-file-net-2.0                   \
65         Test/System.Security.Cryptography.X509Certificates/pkits/ChangeLog      \
66         Test/System.Security.Cryptography.X509Certificates/pkits/Makefile       \
67         Test/System.Security.Cryptography.X509Certificates/pkits/README         \
68         Test/System.Security.Cryptography.X509Certificates/pkits/x509build.cs   \
69         $(RESOURCE_FILES)                               \
70         $(TEST_RESOURCES)
71
72 include ../../build/library.make
73
74 system_library_deps := \
75         $(secxml_libdir)/System.dll             \
76         $(the_libdir_base)System.Xml.dll        \
77         $(the_libdir_base)Mono.Security.dll     \
78         $(bare_libdir)/System.dll
79
80 ifndef PROFILE_ANY_MOBILE
81 system_library_deps += $(the_libdir_base)System.Configuration.dll       
82 endif
83
84 artifacts = $(system_library_deps)                      \
85         $(bare_libdir)/System.Xml.dll                   \
86         $(the_libdir_base)Mono.Security.dll             \
87         $(the_libdir_base)System.Configuration.dll
88
89 .NOTPARALLEL: $(system_library_deps)
90
91 $(the_libdir_base)System.dll: $(system_library_deps) 
92
93 ifeq (bare/,$(intermediate))
94 build-bare:
95 else
96 $(bare_libdir)/System.dll:
97         $(MAKE) intermediate=bare/ $(bare_libdir)/System.dll
98 endif
99
100 ifneq (secxml/,$(intermediate))
101 $(secxml_libdir)/System.dll: $(bare_libdir)/System.dll $(bare_libdir)/System.Xml.dll $(the_libdir_base)Mono.Security.dll $(bare_libdir)/System.dll
102         $(MAKE) intermediate=secxml/ $(secxml_libdir)/System.dll
103 else
104 build-sec:
105 endif
106
107 $(the_libdir_base)System.Xml.dll:
108         (cd ../System.XML; $(MAKE) $@)
109
110 $(bare_libdir)/System.Xml.dll:
111         (cd ../System.XML; $(MAKE) $@)
112
113 $(the_libdir_base)Mono.Security.dll:
114         (cd ../Mono.Security; $(MAKE))
115
116 $(the_libdir_base)System.Configuration.dll:
117         (cd ../System.Configuration; $(MAKE))
118
119 $(build_lib): $(CYCLIC_DEP_FILES)
120
121 $(test_lib): $(test_lib).config $(TEST_RESOURCES)
122
123 $(test_lib).config: Test/test-config-file
124         cp $< $@
125
126 CLEAN_FILES = $(test_lib).config $(bare_libdir)/System.dll $(secxml_libdir)/System.dll $(bare_libdir)/System.dll.mdb $(secxml_libdir)/System.dll.mdb
127
128 # Helper target to run the perl regex test suite
129 regex-check:
130         $(MAKE) check FIXTURE=System.Text.RegularExpressions.PerlTest
131
132 #Debuging target
133 fresh: clean
134         rm -rf ../../class/lib/$(PROFILE)/bare ../../class/lib/$(PROFILE)/bare/ $(system_library_deps)
135
136 ifndef intermediate
137 ifneq ($(PROFILE),basic)
138 csproj-local:
139         $(MAKE) csproj-local intermediate=bare/
140         $(MAKE) csproj-local intermediate=secxml/
141 endif
142 endif