Merge pull request #1319 from directhex/systemwide-per-arch-aot-cache
[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
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 ifeq (2.1, $(FRAMEWORK_VERSION))
31 LIB_MCS_FLAGS += -d:INSIDE_SYSTEM
32 endif
33 ifeq (monotouch, $(subst _runtime,,$(PROFILE)))
34 LIB_MCS_FLAGS += -d:SECURITY_DEP
35 endif
36 ifeq (monodroid, $(PROFILE))
37 LIB_MCS_FLAGS += -d:SECURITY_DEP
38 endif
39 ifndef PROFILE_ANY_MOBILE
40 FINAL_MCS_FLAGS = -r:System.Configuration.dll -d:CONFIGURATION_DEP
41 endif
42
43 #
44 # Flags used to build the secxml version of System.
45 #
46 ifeq (secxml/, $(intermediate))
47 LOCAL_MCS_FLAGS = -lib:$(bare_libdir) 
48 LIB_MCS_FLAGS += -d:SECURITY_DEP -d:XML_DEP -r:PrebuiltSystem=$(bare_libdir)/System.dll -r:System.Xml.dll -r:MonoSecurity=Mono.Security.dll
49 endif
50
51 #
52 # Flags used to build the final version of System (when intermediate is not defined)
53 #
54 ifndef intermediate
55 LIB_MCS_FLAGS += -d:SECURITY_DEP -d:XML_DEP -r:PrebuiltSystem=$(secxml_libdir)/System.dll -r:System.Xml.dll -r:MonoSecurity=Mono.Security.dll $(FINAL_MCS_FLAGS)
56 endif
57
58 EXTRA_DISTFILES = \
59         System.Text.RegularExpressions/notes.txt        \
60         System.ComponentModel.Design/Changelog          \
61         Test/test-config-file                           \
62         Test/test-config-file-net-2.0                   \
63         Test/System.Security.Cryptography.X509Certificates/pkits/ChangeLog      \
64         Test/System.Security.Cryptography.X509Certificates/pkits/Makefile       \
65         Test/System.Security.Cryptography.X509Certificates/pkits/README         \
66         Test/System.Security.Cryptography.X509Certificates/pkits/x509build.cs   \
67         $(RESOURCE_FILES)                               \
68         $(TEST_RESOURCES)
69
70 include ../../build/library.make
71
72 system_library_deps := \
73         $(secxml_libdir)/System.dll             \
74         $(the_libdir_base)System.Xml.dll        \
75         $(the_libdir_base)Mono.Security.dll     \
76         $(bare_libdir)/System.dll
77
78 ifndef PROFILE_ANY_MOBILE
79 system_library_deps += $(the_libdir_base)System.Configuration.dll       
80 endif
81
82 artifacts = $(system_library_deps)                      \
83         $(bare_libdir)/System.Xml.dll                   \
84         $(the_libdir_base)Mono.Security.dll             \
85         $(the_libdir_base)System.Configuration.dll
86
87 .NOTPARALLEL: $(system_library_deps)
88
89 $(the_libdir_base)System.dll: $(system_library_deps) 
90
91 ifeq (bare/,$(intermediate))
92 build-bare:
93 else
94 $(bare_libdir)/System.dll:
95         $(MAKE) intermediate=bare/ $(bare_libdir)/System.dll
96 endif
97
98 ifneq (secxml/,$(intermediate))
99 $(secxml_libdir)/System.dll: $(bare_libdir)/System.dll $(bare_libdir)/System.Xml.dll $(the_libdir_base)Mono.Security.dll $(bare_libdir)/System.dll
100         $(MAKE) intermediate=secxml/ $(secxml_libdir)/System.dll
101 else
102 build-sec:
103 endif
104
105 $(the_libdir_base)System.Xml.dll:
106         (cd ../System.XML; $(MAKE) $@)
107
108 $(bare_libdir)/System.Xml.dll:
109         (cd ../System.XML; $(MAKE) $@)
110
111 $(the_libdir_base)Mono.Security.dll:
112         (cd ../Mono.Security; $(MAKE))
113
114 $(the_libdir_base)System.Configuration.dll:
115         (cd ../System.Configuration; $(MAKE))
116
117 $(build_lib): $(CYCLIC_DEP_FILES)
118
119 $(test_lib): $(test_lib).config $(TEST_RESOURCES)
120
121 ifeq (net_2_0, $(PROFILE))
122 $(test_lib).config: Test/test-config-file-net-2.0
123         cp $< $@
124 else
125 $(test_lib).config: Test/test-config-file
126         cp $< $@
127 endif
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 # run the PKITS tests only if the data was installed/activated, otherwise ignore them
132 ifeq (net_2_0, $(PROFILE))
133 pkits_files := $(wildcard Test/System.Security.Cryptography.X509Certificates/pkits/hint)
134 ifndef pkits_files
135 TEST_HARNESS_EXCLUDES = -exclude=$(PLATFORM_TEST_HARNESS_EXCLUDES)NotWorking,ValueAdd,CAS,InetAccess,PKITS
136 TEST_HARNESS_EXCLUDES_ONDOTNET = -exclude=$(PLATFORM_TEST_HARNESS_EXCLUDES)NotDotNet,CAS,PKITS
137 endif
138 endif
139
140 # Helper target to run the perl regex test suite
141 regex-check:
142         $(MAKE) check FIXTURE=System.Text.RegularExpressions.PerlTest
143
144 #Debuging target
145 fresh: clean
146         rm -rf ../../class/lib/$(PROFILE)/bare ../../class/lib/$(PROFILE)/bare/ $(system_library_deps)
147
148 ifndef intermediate
149 ifneq ($(PROFILE),basic)
150 csproj-local:
151         $(MAKE) csproj-local intermediate=bare/
152         $(MAKE) csproj-local intermediate=secxml/
153 endif
154 endif