2005-02-08 Atsushi Enomoto <atsushi@ximian.com>
[mono.git] / mcs / class / System / Makefile
1 thisdir = class/System
2 SUBDIRS =
3 include ../../build/rules.make
4
5 LIBRARY = System.dll
6 LIBRARY_USE_INTERMEDIATE_FILE = yes
7
8 # Because System.dll, System.Security.dll System.Xml.dll have a cyclic dependency, we need a two-pass build.
9 # 1st pass - build System.dll without System.Xml.dll or System.Security.dll references
10 # 2nd pass - build System.dll with System.Xml.dll and System.Security.dll references
11
12 TEST_RESOURCES = \
13         Test/System/test-uri-props.txt \
14         Test/System/test-uri-props-manual.txt \
15         Test/System/test-uri-relative-props.txt
16
17 LIB_MCS_FLAGS = /r:$(corlib)
18 TEST_MCS_FLAGS = -nowarn:1595 -nowarn:0618 -nowarn:219 -nowarn:67 \
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 := System.Security.dll
29 SECURITY_DEP_FILE := $(wildcard ../lib/$(PROFILE)/$(SECURITY_DEP))
30 CYCLIC_DEPS += $(SECURITY_DEP)
31 CYCLIC_DEP_FILES += $(SECURITY_DEP_FILE)
32 endif
33
34 EXTRA_DISTFILES = \
35         System.Text.RegularExpressions/notes.txt        \
36         System.ComponentModel.Design/Changelog          \
37         Test/test-config-file                           \
38         $(TEST_RESOURCES)
39
40 lib_file := $(wildcard ../lib/$(PROFILE)/System.dll)
41 ifndef lib_file
42 USE_BOOT_COMPILE = yes
43 endif
44
45 ifeq (net_2_0, $(PROFILE))
46 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)
47 endif
48
49 ifdef USE_BOOT_COMPILE
50 LIBRARY_COMPILE = $(BOOT_COMPILE)
51 endif
52
53 ifneq ($(CYCLIC_DEPS:%=../lib/$(PROFILE)/%), $(CYCLIC_DEP_FILES))
54 NO_SIGN_ASSEMBLY = yes
55 all-local: echo-warning
56 .PHONY: echo-warning
57
58 ifeq   (, $(strip $(CYCLIC_DEP_FILES)))
59 echo-warning:
60         @echo "** Warning: System.dll built without parts that depend on: $(CYCLIC_DEPS)"
61 else     # defined CYCLIC_DEP_FILES
62 ifdef      SECURITY_DEP_FILE
63 echo-warning:
64         @echo "** Warning: built System.dll with 'System.Security.dll'-dependent parts"
65         @echo "** Warning: ... without 'System.Xml.dll' present: it may not be usable"
66
67 else
68 echo-warning:
69         @echo "** Warning: System.dll built without parts that depend on System.Security.dll"
70 endif
71 endif
72 endif
73
74 include ../../build/library.make
75
76 ifdef XML_DEP_FILE
77 LIB_MCS_FLAGS += /define:XML_DEP /r:$(XML_DEP)
78 $(the_lib): $(XML_DEP_FILE)
79 endif
80
81 ifdef SECURITY_DEP_FILE
82 LIB_MCS_FLAGS += /define:SECURITY_DEP /r:$(SECURITY_DEP)
83 $(the_lib): $(SECURITY_DEP_FILE)
84 endif
85
86 $(test_lib): $(test_lib).config $(TEST_RESOURCES)
87
88 $(test_lib).config: Test/test-config-file
89         cp $< $@
90
91 CLEAN_FILES = $(test_lib).config