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