2004-05-07 Marek Safar <marek.safar@seznam.cz>
[mono.git] / mcs / class / System / Makefile
1 thisdir = class/System
2 SUBDIRS = 
3 include ../../build/rules.make
4
5 LIBRARY = System.dll
6
7 # Because System.dll and Syste.Xml.dll have cyclic dependency we need two-pass build.
8 # 1st pass - build System.dll without System.Xml.dll reference
9 # 2nd pass - build System.dll with System.Xml.dll reference
10
11 LIB_MCS_FLAGS = /r:$(corlib) $(EXTRA_FLAGS)
12 TEST_MCS_FLAGS = /nowarn:1595 /nowarn:0618
13
14 CYCLIC_DEP = System.Xml.dll
15
16 EXTRA_DISTFILES = \
17         System.Text.RegularExpressions/notes.txt        \
18         System.ComponentModel.Design/Changelog          \
19         Test/test-config-file
20
21 A_SYSTEM = ../lib/$(PROFILE)/System.dll
22 A_SYSTEMXML = ../lib/$(PROFILE)/System.Xml.dll
23
24 ifdef SECOND_PASS
25         include ../../build/library.make
26 all-local:
27         @if test ! -f $(A_SYSTEMXML) ; then exit 0; fi
28         @ if test $(A_SYSTEM) -ot $(A_SYSTEMXML) ; then \
29                 rm -f $(A_SYSTEM); \
30                 $(MAKE) SECOND_PASS=yes EXTRA_FLAGS='/define:XML_DEP /r:$(CYCLIC_DEP)' || exit 1; \
31         fi
32 else
33 # First pass:
34 #   1. Build temporary System.dll without depending on System.Xml.dll
35 #   2. Since mcs.exe depends on System.dll, use BOOT_COMPILE to compile System.dll
36 all-local:
37         @if test ! -f ../lib/$(PROFILE)/$(CYCLIC_DEP) ; then \
38             echo "Creating temporary $(LIBRARY) without $(CYCLIC_DEP) reference." ; \
39             rm -f $(A_SYSTEM); \
40             $(MAKE) SECOND_PASS=yes CSCOMPILE='$(BOOT_COMPILE)' || exit 1 ; \
41             rm -f '$(depsdir)/$(PROFILE)_$(LIBRARY).stamp'; \
42         else \
43             $(MAKE) SECOND_PASS=yes EXTRA_FLAGS='/define:XML_DEP /r:$(CYCLIC_DEP)' || exit 1; \
44         fi
45
46 ## TODO: how to do this without duplication
47
48 install-local:
49             @$(MAKE) SECOND_PASS=yes EXTRA_FLAGS='/r:$(CYCLIC_DEP)' install-local || exit 1; \
50             
51 test-local: all-local
52             @$(MAKE) SECOND_PASS=yes EXTRA_FLAGS='/r:$(CYCLIC_DEP)' test-local || exit 1; \
53             
54 run-test-local:
55             @$(MAKE) SECOND_PASS=yes EXTRA_FLAGS='/r:$(CYCLIC_DEP)' run-test-local || exit 1; \
56             
57 clean-local:
58             @$(MAKE) SECOND_PASS=yes EXTRA_FLAGS='/r:$(CYCLIC_DEP)' clean-local || exit 1; \
59             
60 endif