ad2f217a7a2ddf812a69fc1949930b743e1261db
[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 ifeq (2, $(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 endif
30
31 EXTRA_DISTFILES = \
32         System.Text.RegularExpressions/notes.txt        \
33         System.ComponentModel.Design/Changelog          \
34         Test/test-config-file                           \
35         Test/test-config-file-net-2.0                   \
36         Test/System.Security.Cryptography.X509Certificates/pkits/ChangeLog      \
37         Test/System.Security.Cryptography.X509Certificates/pkits/Makefile       \
38         Test/System.Security.Cryptography.X509Certificates/pkits/README         \
39         Test/System.Security.Cryptography.X509Certificates/pkits/x509build.cs   \
40         $(RESOURCE_FILES)                               \
41         $(TEST_RESOURCES)
42
43 lib_file := $(wildcard ../lib/$(PROFILE)/System.dll)
44 ifdef lib_file
45 ifeq (2.0, $(FRAMEWORK_VERSION))
46 LIB_MCS_FLAGS += -r:PrebuiltSystem=$(lib_file)
47 endif
48 else
49 USE_BOOT_COMPILE = yes
50 endif
51
52 ifeq (net_2_0, $(PROFILE))
53 BOOTSTRAP_MCS = MONO_PATH="$(topdir)/class/lib/net_2_0$(PLATFORM_PATH_SEPARATOR)$(topdir)/class/lib/net_2_0_bootstrap$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_GMCS)
54 endif
55
56 ifdef USE_BOOT_COMPILE
57 LIBRARY_COMPILE = $(BOOT_COMPILE)
58 endif
59
60 # Because System.dll, Mono.Security.dll System.Xml.dll have a cyclic dependency, we need a two-pass build.
61 # 1st pass - build System.dll without System.Xml.dll or Mono.Security.dll or System.Configuration.dll references
62 # 2nd pass - build System.dll with System.Xml.dll and Mono.Security.dll or System.Configuration.dll references
63
64 CYCLIC_DEPS :=
65 CYCLIC_DEP_FILES :=
66
67 # define cyclic-dep
68 # # Note the '$$' -- those are to be delayed till the eval
69 # CYCLIC_DEPS += $1
70 # ifndef USE_BOOT_COMPILE
71 # FILE_$2 := $$(wildcard ../lib/$(PROFILE)/$1)
72 # endif
73 # ifdef FILE_$2
74 # CYCLIC_DEP_FILES += $$(FILE_$2)
75 # LIB_MCS_FLAGS += -d:$2 -r:$1
76 # endif
77 # endef
78
79 ifneq (2.1, $(FRAMEWORK_VERSION))
80 # $(eval $(call cyclic-dep,System.Xml.dll,XML_DEP))
81 CYCLIC_DEPS += System.Xml.dll
82 ifndef USE_BOOT_COMPILE
83 FILE_XML_DEP := $(wildcard ../lib/$(PROFILE)/System.Xml.dll)
84 endif
85 ifdef FILE_XML_DEP
86 CYCLIC_DEP_FILES += $(FILE_XML_DEP)
87 LIB_MCS_FLAGS += -d:XML_DEP -r:System.Xml.dll
88 endif
89
90 endif
91
92 ifeq (2.0, $(FRAMEWORK_VERSION))
93 # $(eval $(call cyclic-dep,Mono.Security.dll,SECURITY_DEP))
94 CYCLIC_DEPS += Mono.Security.dll
95 ifndef USE_BOOT_COMPILE
96 FILE_SECURITY_DEP := $(wildcard ../lib/$(PROFILE)/Mono.Security.dll)
97 endif
98 ifdef FILE_SECURITY_DEP
99 CYCLIC_DEP_FILES += $(FILE_SECURITY_DEP)
100 LIB_MCS_FLAGS += -d:SECURITY_DEP -r:Mono.Security.dll
101 endif
102
103 # $(eval $(call cyclic-dep,System.Configuration.dll,CONFIGURATION_DEP))
104 CYCLIC_DEPS += System.Configuration.dll
105 ifndef USE_BOOT_COMPILE
106 FILE_CONFIGURATION_DEP := $(wildcard ../lib/$(PROFILE)/System.Configuration.dll)
107 endif
108 ifdef FILE_CONFIGURATION_DEP
109 CYCLIC_DEP_FILES += $(FILE_CONFIGURATION_DEP)
110 LIB_MCS_FLAGS += -d:CONFIGURATION_DEP -r:System.Configuration.dll
111 endif
112
113 endif
114
115 MISSING_DEPS := $(filter-out $(notdir $(CYCLIC_DEP_FILES)), $(CYCLIC_DEPS))
116 ifdef MISSING_DEPS
117 NO_SIGN_ASSEMBLY = yes
118 NO_INSTALL = yes
119 all-local: handle-missing-deps
120 .PHONY: handle-missing-deps
121 handle-missing-deps:
122         @echo "** Warning: System.dll built without parts that depend on: $(MISSING_DEPS)"
123         @for f in $(MISSING_DEPS:%=../lib/$(PROFILE)/%); do \
124           test ! -f $$f || { echo "   purging stale $$f"; rm -f $$f; }; done
125 endif
126
127 include ../../build/library.make
128
129 $(the_lib): $(CYCLIC_DEP_FILES)
130
131 $(test_lib): $(test_lib).config $(TEST_RESOURCES)
132
133 ifeq (net_2_0, $(PROFILE))
134 $(test_lib).config: Test/test-config-file-net-2.0
135         cp $< $@
136 else
137 $(test_lib).config: Test/test-config-file
138         cp $< $@
139 endif
140
141 CLEAN_FILES = $(test_lib).config
142
143 # run the PKITS tests only if the data was installed/activated, otherwise ignore them
144 ifeq (net_2_0, $(PROFILE))
145 pkits_files := $(wildcard Test/System.Security.Cryptography.X509Certificates/pkits/hint)
146 ifndef pkits_files
147 TEST_HARNESS_EXCLUDES = -exclude=$(PLATFORM_TEST_HARNESS_EXCLUDES)NotWorking,ValueAdd,CAS,InetAccess,PKITS
148 TEST_HARNESS_EXCLUDES_ONDOTNET = -exclude=$(PLATFORM_TEST_HARNESS_EXCLUDES)NotDotNet,CAS,PKITS
149 endif
150 endif
151
152 # Helper target to run the perl regex test suite
153 regex-check:
154         $(MAKE) check FIXTURE=System.Text.RegularExpressions.PerlTest