* roottypes.cs: Rename from tree.cs.
[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 # Because System.dll, Mono.Security.dll System.Xml.dll have a cyclic dependency, we need a two-pass build.
10 # 1st pass - build System.dll without System.Xml.dll or Mono.Security.dll or System.Configuration.dll references
11 # 2nd pass - build System.dll with System.Xml.dll and Mono.Security.dll or System.Configuration.dll references
12
13 TEST_RESOURCES = \
14         Test/System/test-uri-props.txt \
15         Test/System/test-uri-props-manual.txt \
16         Test/System/test-uri-relative-props.txt
17
18 TEST_MCS_FLAGS = -r:System.Drawing.dll -r:Mono.Security.dll -nowarn:1595 -nowarn:0618 -nowarn:219 -nowarn:67 -nowarn:169 -nowarn:612 \
19         $(foreach f, $(TEST_RESOURCES), -resource:$(f),$(notdir $(f)))
20
21 XML_DEP := System.Xml.dll
22 XML_DEP_FILE := $(wildcard ../lib/$(PROFILE)/$(XML_DEP))
23 CYCLIC_DEPS := $(XML_DEP)
24 CYCLIC_DEP_FILES := $(XML_DEP_FILE)
25
26 ifeq (2.0, $(FRAMEWORK_VERSION))
27 # Happens on net_2_0_bootstrap and net_2_0 profiles
28 SECURITY_DEP := Mono.Security.dll
29 SECURITY_DEP_FILE := $(wildcard ../lib/$(PROFILE)/$(SECURITY_DEP))
30 CONFIGURATION_DEP := System.Configuration.dll
31 CONFIGURATION_DEP_FILE := $(wildcard ../lib/$(PROFILE)/$(CONFIGURATION_DEP))
32 CYCLIC_DEPS += $(SECURITY_DEP) $(CONFIGURATION_DEP)
33 CYCLIC_DEP_FILES += $(SECURITY_DEP_FILE) $(CONFIGURATION_DEP_FILE)
34 LIB_MCS_FLAGS = -nowarn:618 -d:CONFIGURATION_2_0 -unsafe
35 TEST_MCS_FLAGS += -r:System.Configuration
36 endif
37
38 EXTRA_DISTFILES = \
39         System.Text.RegularExpressions/notes.txt        \
40         System.ComponentModel.Design/Changelog          \
41         Test/test-config-file                           \
42         $(TEST_RESOURCES)
43
44 lib_file := $(wildcard ../lib/$(PROFILE)/System.dll)
45 ifndef lib_file
46 USE_BOOT_COMPILE = yes
47 endif
48
49 ifeq (net_2_0, $(PROFILE))
50 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)
51 endif
52
53 ifdef USE_BOOT_COMPILE
54 LIBRARY_COMPILE = $(BOOT_COMPILE)
55 endif
56
57 ifneq ($(CYCLIC_DEPS:%=../lib/$(PROFILE)/%), $(CYCLIC_DEP_FILES))
58 NO_SIGN_ASSEMBLY = yes
59 NO_INSTALL = yes
60 all-local: echo-warning
61 .PHONY: echo-warning
62
63 ifeq   (, $(strip $(CYCLIC_DEP_FILES)))
64 echo-warning:
65         @echo "** Warning: System.dll built without parts that depend on: $(CYCLIC_DEPS)"
66 else     # defined CYCLIC_DEP_FILES
67 ifdef      SECURITY_DEP_FILE
68 echo-warning:
69         @echo "** Warning: built System.dll with 'Mono.Security.dll'-dependent parts"
70         @echo "** Warning: ... without 'System.Xml.dll' present: it may not be usable"
71         @echo "** Warning: ... without 'System.Configuration.dll' present: it may not be usable"
72 else
73 echo-warning:
74         @echo "** Warning: System.dll built without parts that depend on Mono.Security.dll"
75 endif
76 endif
77 endif
78
79 include ../../build/library.make
80
81 ifdef XML_DEP_FILE
82 LIB_MCS_FLAGS += -define:XML_DEP -r:$(XML_DEP)
83 $(the_lib): $(XML_DEP_FILE)
84 endif
85
86 ifdef SECURITY_DEP_FILE
87 LIB_MCS_FLAGS += -define:SECURITY_DEP -r:Mono.Security.dll
88 $(the_lib): $(SECURITY_DEP_FILE)
89 endif
90
91 ifdef CONFIGURATION_DEP_FILE
92 LIB_MCS_FLAGS += -define:CONFIGURATION_DEP -r:$(CONFIGURATION_DEP) -r:PrebuiltSystem=$(topdir)/class/lib/$(PROFILE)/System.dll
93 $(the_lib): $(CONFIGURATION_DEP_FILE)
94 endif
95
96 $(test_lib): $(test_lib).config $(TEST_RESOURCES)
97
98 $(test_lib).config: Test/test-config-file
99         cp $< $@
100
101 CLEAN_FILES = $(test_lib).config