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