Merge branch 'master' of github.com:mono/mono
[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 LIBRARY_USE_INTERMEDIATE_FILE = yes
8
9 ifneq (2.1, $(FRAMEWORK_VERSION))
10 RESOURCE_FILES = \
11         resources/Asterisk.wav  \
12         resources/Beep.wav      \
13         resources/Exclamation.wav       \
14         resources/Hand.wav      \
15         resources/Question.wav
16 endif
17
18 TEST_RESOURCES = \
19         Test/System/test-uri-props.txt \
20         Test/System/test-uri-props-manual.txt \
21         Test/System/test-uri-relative-props.txt
22
23 TEST_MCS_FLAGS = -r:System.Drawing.dll -r:Mono.Security.dll -r:System.Data -nowarn:1595 -nowarn:0618 -nowarn:219 -nowarn:67 -nowarn:169 -nowarn:612 \
24         $(foreach f, $(TEST_RESOURCES), -resource:$(f),$(notdir $(f)))
25
26 ifneq (1, $(FRAMEWORK_VERSION_MAJOR))
27 LIB_MCS_FLAGS = -nowarn:618 -d:CONFIGURATION_2_0 -unsafe $(RESOURCE_FILES:%=-resource:%)
28 TEST_MCS_FLAGS += -r:System.Configuration
29 PROFILE_2_OR_4 := $(filter net_2_0 net_4_0, $(PROFILE))
30 NOT_SL := $(filter net_2_0 net_4_0 monotouch monodroid, $(PROFILE))
31 endif
32 ifeq (2.1, $(FRAMEWORK_VERSION))
33 LIB_MCS_FLAGS += -d:INSIDE_SYSTEM
34 ifeq (moonlight_raw, $(PROFILE))
35 LIB_MCS_FLAGS += -d:SECURITY_DEP
36 endif
37 endif
38
39 EXTRA_DISTFILES = \
40         System.Text.RegularExpressions/notes.txt        \
41         System.ComponentModel.Design/Changelog          \
42         Test/test-config-file                           \
43         Test/test-config-file-net-2.0                   \
44         Test/System.Security.Cryptography.X509Certificates/pkits/ChangeLog      \
45         Test/System.Security.Cryptography.X509Certificates/pkits/Makefile       \
46         Test/System.Security.Cryptography.X509Certificates/pkits/README         \
47         Test/System.Security.Cryptography.X509Certificates/pkits/x509build.cs   \
48         $(RESOURCE_FILES)                               \
49         $(TEST_RESOURCES)
50
51 lib_file := $(wildcard ../lib/$(PROFILE)/System.dll)
52 ifdef lib_file
53 ifdef NOT_SL
54 LIB_MCS_FLAGS += -r:PrebuiltSystem=$(lib_file)
55 endif
56 else
57 USE_BOOT_COMPILE = yes
58 endif
59
60 ifdef USE_BOOT_COMPILE
61 ifndef PROFILE_MCS_HAS_BOOTSTRAP_FALLBACK
62 LIBRARY_COMPILE = $(BOOT_COMPILE)
63 endif
64 endif
65
66 # Because System.dll, Mono.Security.dll System.Xml.dll have a cyclic dependency, we need a two-pass build.
67 # 1st pass - build System.dll without System.Xml.dll or Mono.Security.dll or System.Configuration.dll references
68 # 2nd pass - build System.dll with System.Xml.dll and Mono.Security.dll or System.Configuration.dll references
69
70 CYCLIC_DEPS :=
71 CYCLIC_DEP_FILES :=
72
73 # define cyclic-dep
74 # # Note the '$$' -- those are to be delayed till the eval
75 # CYCLIC_DEPS += $1
76 # ifndef USE_BOOT_COMPILE
77 # FILE_$2 := $$(wildcard ../lib/$(PROFILE)/$1)
78 # endif
79 # ifdef FILE_$2
80 # CYCLIC_DEP_FILES += $$(FILE_$2)
81 # LIB_MCS_FLAGS += -d:$2 -r:$1
82 # endif
83 # endef
84
85 ifneq (2.1, $(FRAMEWORK_VERSION))
86 # $(eval $(call cyclic-dep,System.Xml.dll,XML_DEP))
87 CYCLIC_DEPS += System.Xml.dll
88 ifndef USE_BOOT_COMPILE
89 FILE_XML_DEP := $(wildcard ../lib/$(PROFILE)/System.Xml.dll)
90 endif
91 ifdef FILE_XML_DEP
92 CYCLIC_DEP_FILES += $(FILE_XML_DEP)
93 LIB_MCS_FLAGS += -d:XML_DEP -r:System.Xml.dll
94 endif
95
96 endif
97
98 ifdef NOT_SL
99 # $(eval $(call cyclic-dep,Mono.Security.dll,SECURITY_DEP))
100 CYCLIC_DEPS += Mono.Security.dll
101 ifndef USE_BOOT_COMPILE
102 FILE_SECURITY_DEP := $(wildcard ../lib/$(PROFILE)/Mono.Security.dll)
103 endif
104 ifdef FILE_SECURITY_DEP
105 CYCLIC_DEP_FILES += $(FILE_SECURITY_DEP)
106 LIB_MCS_FLAGS += -d:SECURITY_DEP -r:Mono.Security.dll
107 endif
108
109 # $(eval $(call cyclic-dep,System.Configuration.dll,CONFIGURATION_DEP))
110 CYCLIC_DEPS += System.Configuration.dll
111 ifndef USE_BOOT_COMPILE
112 FILE_CONFIGURATION_DEP := $(wildcard ../lib/$(PROFILE)/System.Configuration.dll)
113 endif
114 ifdef FILE_CONFIGURATION_DEP
115 CYCLIC_DEP_FILES += $(FILE_CONFIGURATION_DEP)
116 LIB_MCS_FLAGS += -d:CONFIGURATION_DEP -r:System.Configuration.dll
117 endif
118
119 endif
120
121 MISSING_DEPS := $(filter-out $(notdir $(CYCLIC_DEP_FILES)), $(CYCLIC_DEPS))
122 ifdef MISSING_DEPS
123 NO_SIGN_ASSEMBLY = yes
124 NO_INSTALL = yes
125 all-local: handle-missing-deps
126 .PHONY: handle-missing-deps
127 handle-missing-deps:
128         @echo "** Warning: System.dll built without parts that depend on: $(MISSING_DEPS)"
129         @for f in $(MISSING_DEPS:%=../lib/$(PROFILE)/%); do \
130           test ! -f $$f || { echo "   purging stale $$f"; rm -f $$f; }; done
131 endif
132
133 include ../../build/library.make
134
135 $(build_lib): $(CYCLIC_DEP_FILES)
136
137 $(test_lib): $(test_lib).config $(TEST_RESOURCES)
138
139 ifeq (net_2_0, $(PROFILE))
140 $(test_lib).config: Test/test-config-file-net-2.0
141         cp $< $@
142 else
143 $(test_lib).config: Test/test-config-file
144         cp $< $@
145 endif
146
147 CLEAN_FILES = $(test_lib).config
148
149 # run the PKITS tests only if the data was installed/activated, otherwise ignore them
150 ifeq (net_2_0, $(PROFILE))
151 pkits_files := $(wildcard Test/System.Security.Cryptography.X509Certificates/pkits/hint)
152 ifndef pkits_files
153 TEST_HARNESS_EXCLUDES = -exclude=$(PLATFORM_TEST_HARNESS_EXCLUDES)NotWorking,ValueAdd,CAS,InetAccess,PKITS
154 TEST_HARNESS_EXCLUDES_ONDOTNET = -exclude=$(PLATFORM_TEST_HARNESS_EXCLUDES)NotDotNet,CAS,PKITS
155 endif
156 endif
157
158 # Helper target to run the perl regex test suite
159 regex-check:
160         $(MAKE) check FIXTURE=System.Text.RegularExpressions.PerlTest