First step to import referencesource System.Xml.
[mono.git] / mcs / class / System.XML / Makefile
1 thisdir = class/System.XML
2 SUBDIRS = 
3 include ../../build/rules.make
4
5 LIBRARY = System.Xml.dll
6
7 lib_file := $(wildcard ../lib/$(PROFILE)/System.Xml.dll)
8 ifndef lib_file
9 USE_BOOT_COMPILE = yes
10 endif
11
12 ifdef USE_BOOT_COMPILE
13 LIBRARY_COMPILE = $(BOOT_COMPILE)
14 endif
15
16 PROFILE_ANY_MOBILE := $(filter monotouch monotouch_runtime monodroid xammac mobile mobile_static, $(PROFILE))
17
18 LIB_REFS = System
19 LIB_MCS_FLAGS = -r:$(corlib) -r:System.dll -nowarn:0618,0612,0642 -unsafe -d:ASYNC -d:DISABLE_CAS_USE -d:MONO_HYBRID_SYSTEM_XML
20
21 ifeq (2.1, $(FRAMEWORK_VERSION))
22 LIB_MCS_FLAGS += -unsafe -d:AGCLR -d:NET_2_1_HACK
23 endif
24 TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -nowarn:0618 -nowarn:219 -nowarn:169 -r:System.Data.dll -r:System.Core.dll
25
26 ifndef PROFILE_ANY_MOBILE
27 FINAL_MCS_FLAGS = -r:System.Configuration.dll -d:CONFIGURATION_DEP
28 endif
29
30 ifneq (bare/,$(intermediate))
31 LIB_MCS_FLAGS += $(FINAL_MCS_FLAGS)
32 endif
33
34 LOCAL_MCS_FLAGS += -lib:$(bare_libdir)
35
36 nist_dom_files = \
37         ChangeLog ITest.cs readme.txt util.cs \
38         fundamental/ChangeLog \
39         files/ChangeLog files/noDTDXMLfile.xml files/otherDoc.xml files/staff.dtd files/staff.html files/staff.xml
40
41 xmlfiles_files = \
42         ChangeLog nested-included.dtd literal-data.xml nested-dtd-test.dtd nested-dtd-test.xml simple.xml \
43         xsl/ChangeLog xsl/empty.xsl \
44         XsdValidation/ChangeLog XsdValidation/1.xsd XsdValidation/2.xsd XsdValidation/3.xsd XsdValidation/4.xsd \
45         xsd/ChangeLog xsd/1.xsd xsd/2.xsd xsd/3.xsd xsd/4.xsd xsd/5.xsd xsd/6.xsd xsd/xml.xsd xsd/81360.xsd xsd/81360inc1.xsd xsd/81360inc2.xsd
46
47 EXTRA_DISTFILES = \
48         System.Xml.Schema/BUGS-MS.txt   \
49         System.Xml.Schema/BUGS.txt      \
50         $(wildcard System.Xml.Serialization/standalone_tests/*.cs) \
51         $(wildcard System.Xml.Serialization/standalone_tests/*.output) \
52         System.Xml.XPath/Parser.jay     \
53         Test/ChangeLog                  \
54         Test/Microsoft.Test.csproj      \
55         Test/Mono.Test.csproj           \
56         Test/MonoMicro.Test.csproj      \
57         Test/XmlFiles/76102.xml         \
58         Test/XmlFiles/79683.dtd         \
59         Test/XmlFiles/496192.xml        \
60         Test/XmlFiles/*.xsd     \
61         $(wildcard Test/XmlFiles/xsd/*.xml) \
62         $(wildcard Test/XmlFiles/xsd/*.xsd) \
63         $(wildcard Test/XmlFiles/xsl/*.xml) \
64         $(wildcard Test/XmlFiles/xsl/*.xsl) \
65         Test/XmlFiles/xsl/current-in-select.ref \
66         Test/XmlFiles/xsl/ChangeLog \
67         $(xmlfiles_files:%=Test/XmlFiles/%) \
68         $(nist_dom_files:%=Test/System.Xml/nist_dom/%)
69
70 ifneq (net_4_5, $(PROFILE))
71
72 System.Xml.XPath/$(PROFILE)_Parser.cs: System.Xml.XPath/Parser.jay $(topdir)/jay/skeleton.cs
73         (cd System.Xml.XPath; $(topdir)/../jay/jay -ct < $(topdir)/../jay/skeleton.cs Parser.jay > $(PROFILE)_Parser.cs)
74
75 Mono.Xml.Xsl/$(PROFILE)_PatternParser.jay: System.Xml.XPath/Parser.jay $(topdir)/jay/skeleton.cs
76         sed "s/\%start Expr/\%start Pattern/" $< >$@
77
78 Mono.Xml.Xsl/$(PROFILE)_PatternParser.cs: Mono.Xml.Xsl/$(PROFILE)_PatternParser.jay $(topdir)/jay/skeleton.cs
79         echo "#define XSLT_PATTERN" > $@
80         (cd Mono.Xml.Xsl; $(topdir)/../jay/jay -ct $(PROFILE)_PatternParser.jay < $(topdir)/../jay/skeleton.cs >> $(PROFILE)_PatternParser.cs)
81
82 Mono.Xml.Xsl/$(PROFILE)_PatternTokenizer.cs: System.Xml.XPath/Tokenizer.cs
83         echo "#define XSLT_PATTERN" > $@
84         cat $< >>$@
85
86 ifneq (moonlight_raw, $(PROFILE))
87 BUILT_SOURCES = System.Xml.XPath/$(PROFILE)_Parser.cs \
88         Mono.Xml.Xsl/$(PROFILE)_PatternParser.cs \
89         Mono.Xml.Xsl/$(PROFILE)_PatternTokenizer.cs
90
91 CLEAN_FILES = Test/XmlFiles/xsl/result.xml \
92         System.Xml.XPath/$(PROFILE)_Parser.cs \
93         Mono.Xml.Xsl/$(PROFILE)_PatternParser.cs \
94         Mono.Xml.Xsl/$(PROFILE)_PatternTokenizer.cs
95 endif
96
97 endif
98
99 include ../../build/library.make
100
101 ifeq (bare/,$(intermediate))
102 build-bare:
103 else
104 $(bare_libdir)/System.Xml.dll:
105         $(MAKE) intermediate=bare/ $(bare_libdir)/System.Xml.dll
106 endif
107
108 system_xml_library_deps :=                              \
109         $(bare_libdir)/System.dll                       \
110         $(bare_libdir)/System.Xml.dll
111
112 ifndef PROFILE_ANY_MOBILE
113 system_xml_library_deps += $(the_libdir_base)System.Configuration.dll
114 endif
115
116 artifacts = $(system_xml_library_deps)  \
117         $(the_libdir_base)System.Configuration.dll
118
119 .NOTPARALLEL: $(artifacts)
120
121 CLEAN_FILES = $(bare_libdir)/System.Xml.dll $(bare_libdir)/System.Xml.dll.pdb
122 $(the_libdir_base)System.Xml.dll: $(system_xml_library_deps) 
123 $(bare_libdir)/System.dll:
124         (cd ../System; $(MAKE) $@)
125 $(bare_libdir)/System.Xml.dll: $(bare_libdir)/System.dll 
126
127 $(the_libdir_base)System.Configuration.dll:
128         (cd ../System.Configuration; $(MAKE) $@)
129
130
131 ifndef intermediate
132 ifneq ($(PROFILE),basic)
133 csproj-local:
134         $(MAKE) csproj-local intermediate=bare/
135 endif
136 endif