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