[corlib] Fixed StringBuilder construction bugs in marshalling caused by changes to...
[mono.git] / mcs / tools / mdoc / Makefile
1 thisdir = tools/mdoc
2 SUBDIRS = 
3 include ../../build/rules.make
4
5 MDOC_COMMON_FLAGS = \
6         /resource:../../class/monodoc/Resources/mdoc-html-format.xsl,mdoc-html-format.xsl    \
7         /resource:../../class/monodoc/Resources/mdoc-html-utils.xsl,mdoc-html-utils.xsl      \
8         /resource:../../class/monodoc/Resources/mdoc-sections-css.xsl,mdoc-sections-css.xsl  \
9         /resource:../../class/monodoc/Resources/mono-ecma-css.xsl,mono-ecma-css.xsl          \
10         /resource:Resources/defaulttemplate.xsl,defaulttemplate.xsl                 \
11         /resource:Resources/monodoc-ecma.xsd,monodoc-ecma.xsd                       \
12         /resource:Resources/msitomsx.xsl,msitomsx.xsl                               \
13         /resource:Resources/overview.xsl,overview.xsl                               \
14         /resource:Resources/stylesheet.xsl,stylesheet.xsl                           \
15         /r:System.Web.dll                                                           \
16         /r:System.Xml.Linq.dll                                                      \
17         /r:ICSharpCode.SharpZipLib.dll                                              \
18         /r:Mono.Cecil.dll
19
20 LOCAL_MCS_FLAGS = $(MDOC_COMMON_FLAGS) \
21         /r:monodoc.dll
22 PROGRAM = mdoc.exe
23 PROGRAM_DEPS = $(topdir)/class/lib/$(PROFILE)/monodoc.dll
24
25 ifdef NET
26 all : copy-with-deps
27
28 copy-with-deps:
29         -mkdir mdoc-net
30         cp $(PROGRAM) mdoc-net
31         cp $(topdir)/class/lib/$(PROFILE)/Commons.Xml.Relaxng.dll mdoc-net
32         cp $(topdir)/class/lib/$(PROFILE)/ICSharpCode.SharpZipLib.dll mdoc-net
33         cp $(topdir)/class/lib/$(PROFILE)/Mono.Cecil.dll mdoc-net
34         cp $(topdir)/class/lib/$(PROFILE)/monodoc.dll mdoc-net
35 endif
36
37 MONODOC_RESOURCES = \
38         ../../class/monodoc/Resources/mdoc-html-utils.xsl    \
39         ../../class/monodoc/Resources/mdoc-sections-css.xsl  \
40         ../../class/monodoc/Resources/mono-ecma-css.xsl
41
42 MDOC_RESOURCES = \
43         Resources/defaulttemplate.xsl     \
44         Resources/monodoc-ecma.xsd        \
45         Resources/msitomsx.xsl            \
46         Resources/overview.xsl            \
47         Resources/stylesheet.xsl
48
49 MDOC_TEST_FILES = \
50         Test/CLILibraryTypes.dtd                                  \
51         Test/DocTest-v1.cs                                        \
52         Test/DocTest-v2.patch                                     \
53         Test/msxdoc-expected.importslashdoc.xml                   \
54         Test/TestEcmaDocs.xml                                     \
55         Test/validate.check.monodocer                             \
56         Test/validate.check.monodocer.importslashdoc              \
57         Test/validate.check.monodocer.since
58
59 EXTRA_DISTFILES = \
60         $(MDOC_RESOURCES) \
61         $(MDOC_TEST_FILES)
62
63 $(PROGRAM) : $(MDOC_RESOURCES) $(MONODOC_RESOURCES) $(PROGRAM_DEPS)
64
65 PROGRAM_COMPILE = $(CSCOMPILE) -platform:x86
66
67 include ../../build/executable.make
68
69 $(PROGRAM) : $(build_lib)
70         cp $< $@
71
72 $(PROGRAM) : Makefile
73
74 MONO = \
75         MONO_PATH="$(topdir)/class/lib/$(PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" \
76         $(RUNTIME) $(RUNTIME_FLAGS)
77
78 dist-local: dist-default dist-tests
79
80 dist-tests:
81         find Test/en.expected* -name '*.xml'     > .files
82         find Test/html.expected* -name '*.html' >> .files
83         tar cTf .files - | (cd $(distdir); tar xf -)
84         rm .files ; \
85
86 test-local: $(PROGRAM)
87
88 clean-local: cleanup
89
90 cleanup:
91         -rm -Rf Test/en.actual Test/html.actual
92         -rm -f monodocer1.exe*
93
94 Test/DocTest-DropNS-classic-secondary.dll:
95         @echo $(value @)
96         $(CSCOMPILE) $(TEST_CSCFLAGS) -debug -unsafe -target:library -out:$@ Test/DocTest-DropNS-classic-secondary.cs
97
98 Test/DocTest-DropNS-classic.dll:
99         @echo $(value @)
100         $(CSCOMPILE) $(TEST_CSCFLAGS) -debug -unsafe -target:library -out:$@ Test/DocTest-DropNS-classic.cs
101
102 Test/DocTest-DropNS-unified.dll:
103         $(CSCOMPILE) $(TEST_CSCFLAGS) -debug -unsafe -target:library -out:$@ Test/DocTest-DropNS-unified.cs
104
105 Test/DocTest.dll: 
106         $(CSCOMPILE) $(TEST_CSCFLAGS) -debug -unsafe -target:library -out:$@ Test/DocTest.cs
107
108 Test/DocTest-InternalInterface.dll: 
109         $(CSCOMPILE) $(TEST_CSCFLAGS) -debug -unsafe -target:library -out:$@ Test/DocTest-InternalInterface.cs
110
111 Test/DocTest.dll-v1: 
112         -rm -f Test/DocTest.cs
113         cp Test/DocTest-v1.cs Test/DocTest.cs
114         -rm -f Test/DocTest.dll
115         $(MAKE) TEST_CSCFLAGS=$(TEST_CSCFLAGS) Test/DocTest.dll
116
117 Test/DocTest.dll-v2: 
118         -rm -f Test/DocTest.cs
119         cp Test/DocTest-v1.cs Test/DocTest.cs
120         cd Test && patch -p0 < DocTest-v2.patch
121         -rm -f Test/DocTest.dll
122         $(MAKE) TEST_CSCFLAGS=$(TEST_CSCFLAGS) Test/DocTest.dll
123
124 check-monodocer-dropns-classic: $(PROGRAM)
125         # tests the simplest --dropns case, a single class where the root namespace was dropped.
126         -rm -Rf Test/en.actual
127         $(MAKE) Test/DocTest-DropNS-classic.dll
128         $(MONO) $(PROGRAM) update --exceptions=all -o Test/en.actual Test/DocTest-DropNS-classic.dll
129         $(MAKE) update-monodocer-dropns-unified
130         diff --exclude=.svn -rup Test/en.expected-dropns-classic-v1 Test/en.actual
131
132 check-monodocer-dropns-classic-withsecondary: $(PROGRAM)
133         # tests case where a secondary assembly is included with a --dropns parameter
134         -rm -Rf Test/en.actual
135         $(MAKE) Test/DocTest-DropNS-classic.dll
136         $(MAKE) Test/DocTest-DropNS-classic-secondary.dll
137         $(MONO) $(PROGRAM) update --exceptions=all -o Test/en.actual Test/DocTest-DropNS-classic.dll Test/DocTest-DropNS-classic-secondary.dll
138         $(MAKE) update-monodocer-dropns-unified-withsecondary
139         diff --exclude=.svn -rup Test/en.expected-dropns-classic-withsecondary Test/en.actual
140
141 update-monodocer-dropns-unified: $(PROGRAM)
142         $(MAKE) Test/DocTest-DropNS-unified.dll
143         $(MONO) $(PROGRAM) update --exceptions=all -o Test/en.actual Test/DocTest-DropNS-unified.dll --dropns Test/DocTest-DropNS-unified.dll=MyFramework
144
145 update-monodocer-dropns-unified-withsecondary: $(PROGRAM)
146         $(MAKE) Test/DocTest-DropNS-unified.dll
147         $(MONO) $(PROGRAM) update --exceptions=all -o Test/en.actual Test/DocTest-DropNS-unified.dll Test/DocTest-DropNS-classic-secondary.dll --dropns Test/DocTest-DropNS-unified.dll=MyFramework
148
149 update-monodocer-dropns-classic-secondary: $(PROGRAM)
150         $(MAKE) Test/DocTest-DropNS-classic-secondary.dll
151         $(MONO) $(PROGRAM) update --exceptions=all -o Test/en.actual Test/DocTest-DropNS-classic-secondary.dll
152
153 check-monodocer-internal-interface: $(PROGRAM)
154         # Tests to make sure internal interfaces that are explicitly implemented are not documented
155         -rm -Rf Test/en.actual
156         $(MAKE) Test/DocTest-InternalInterface.dll
157         $(MONO) $(PROGRAM) update --exceptions=all -o Test/en.actual Test/DocTest-InternalInterface.dll
158         diff --exclude=.svn -rup Test/en.expected-internal-interface Test/en.actual
159
160 check-monodocer-update: $(PROGRAM)
161         find Test/en.expected -name \*.xml -exec rm "{}" \;
162         $(MAKE) Test/DocTest.dll-v1
163         $(MONO) $(PROGRAM) update --exceptions=all -o Test/en.expected Test/DocTest.dll
164
165 check-monodocer: $(PROGRAM)
166         -rm -Rf Test/en.actual
167         $(MAKE) Test/DocTest.dll-v1
168         $(MONO) $(PROGRAM) update --debug --exceptions=all -o Test/en.actual Test/DocTest.dll
169         diff --exclude=.svn -rup Test/en.expected Test/en.actual
170         $(MONO) $(PROGRAM) update --debug --exceptions=all -o Test/en.actual Test/DocTest.dll 
171         diff --exclude=.svn -rup Test/en.expected Test/en.actual
172
173 check-monodocer-since-update: $(PROGRAM)
174         find Test/en.expected.since -name \*.xml -exec rm "{}" \;
175         $(MAKE) Test/DocTest.dll-v1
176         $(MONO) $(PROGRAM) update --exceptions=all -o Test/en.expected.since Test/DocTest.dll 
177         $(MAKE) Test/DocTest.dll-v2
178         $(MONO) $(PROGRAM) update --exceptions=all --since="Version 2.0" \
179                 -o Test/en.expected.since Test/DocTest.dll 
180
181 check-monodocer-since: $(PROGRAM)
182         rm -Rf Test/en.actual
183         $(MAKE) Test/DocTest.dll-v1
184         $(MONO) $(PROGRAM) --debug update --exceptions=all -o Test/en.actual Test/DocTest.dll 
185         $(MAKE) Test/DocTest.dll-v2
186         $(MONO) $(PROGRAM) --debug update --exceptions=all --since="Version 2.0" \
187                 -o Test/en.actual Test/DocTest.dll 
188         diff --exclude=.svn -rup Test/en.expected.since Test/en.actual
189
190 check-monodocer-delete-update: $(PROGRAM)
191         find Test/en.expected.delete -type f -exec rm "{}" \;
192         $(MAKE) Test/DocTest.dll-v1
193         $(MONO) $(PROGRAM) update --exceptions=all -o Test/en.expected.delete Test/DocTest.dll
194         $(MAKE) Test/DocTest.dll-v2
195         $(MONO) $(PROGRAM) update --exceptions=all -o Test/en.expected.delete Test/DocTest.dll
196         $(MAKE) Test/DocTest.dll-v1
197         $(MONO) $(PROGRAM) update -fno-assembly-versions --delete --exceptions=all \
198                 -o Test/en.expected.delete Test/DocTest.dll
199
200 check-monodocer-delete: $(PROGRAM)
201         rm -Rf Test/en.actual
202         $(MAKE) Test/DocTest.dll-v1
203         $(MONO) $(PROGRAM) --debug update --exceptions=all -o Test/en.actual Test/DocTest.dll
204         $(MAKE) Test/DocTest.dll-v2
205         $(MONO) $(PROGRAM) --debug update --exceptions=all -o Test/en.actual Test/DocTest.dll
206         $(MAKE) Test/DocTest.dll-v1
207         $(MONO) $(PROGRAM) --debug update -fno-assembly-versions --delete --exceptions=all -o Test/en.actual Test/DocTest.dll
208         diff --exclude=.svn -rup Test/en.expected.delete Test/en.actual
209
210 check-monodocer-importslashdoc-update: $(PROGRAM)
211         find Test/en.expected.importslashdoc -name \*.xml -exec rm "{}" \;
212         $(MAKE) Test/DocTest.dll-v1 TEST_CSCFLAGS=-doc:Test/DocTest.xml
213         $(MONO) $(PROGRAM) --debug update --exceptions=all -i Test/DocTest.xml \
214                 -o Test/en.expected.importslashdoc Test/DocTest.dll 
215
216 check-monodocer-importslashdoc: $(PROGRAM)
217         rm -Rf Test/en.actual
218         $(MAKE) Test/DocTest.dll-v1 TEST_CSCFLAGS=-doc:Test/DocTest.xml
219         $(MONO) $(PROGRAM) --debug update --exceptions=all -i Test/DocTest.xml \
220                 -o Test/en.actual Test/DocTest.dll 
221         diff --exclude=.svn -rup Test/en.expected.importslashdoc Test/en.actual
222
223 check-monodocer-importecmadoc-update: $(PROGRAM)
224         find Test/en.expected.importecmadoc -name \*.xml -exec rm "{}" \;
225         $(MAKE) Test/DocTest.dll-v1
226         $(MONO) $(PROGRAM) --debug update --exceptions=all -i Test/TestEcmaDocs.xml \
227                 '--type=System.Action`1' --type=System.AsyncCallback \
228                 --type=System.Environment --type=System.Array \
229                 -o Test/en.expected.importecmadoc Test/DocTest.dll 
230
231 check-monodocer-importecmadoc: $(PROGRAM)
232         rm -Rf Test/en.actual
233         $(MAKE) Test/DocTest.dll-v1
234         $(MONO) $(PROGRAM) --debug update --exceptions=all -i Test/TestEcmaDocs.xml \
235                 '--type=System.Action`1' --type=System.AsyncCallback \
236                 --type=System.Environment --type=System.Array \
237                 -o Test/en.actual Test/DocTest.dll 
238         diff --exclude=.svn -rup Test/en.expected.importecmadoc Test/en.actual
239
240 check-mdoc-export-html-update: $(PROGRAM)
241         find Test/html.expected -name \*.html -exec rm "{}" \;
242         $(MONO) $(PROGRAM) export-html -o Test/html.expected \
243                 Test/en.expected.importslashdoc 
244
245 check-mdoc-export-html: check-monodocer $(PROGRAM)
246         rm -Rf Test/html.actual
247         $(MONO) $(PROGRAM) export-html -o Test/html.actual \
248                 Test/en.expected.importslashdoc
249         diff --exclude=.svn -rup Test/html.expected Test/html.actual
250
251 check-mdoc-export-html-with-version: $(PROGRAM)
252         rm -Rf Test/html.actual.v0 Test/html.actual.since-with-v0 .v0.txt .v2.txt
253         $(MONO) $(PROGRAM) export-html -o Test/html.actual.v0 \
254                 Test/en.expected
255         $(MONO) $(PROGRAM) export-html -o Test/html.actual.since-with-v0 \
256                 Test/en.expected.since -with-version 0.0.0.0
257         (cd Test/html.actual.v0            && find . -type f) | sort > .v0.txt
258         (cd Test/html.actual.since-with-v0 && find . -type f) | sort > .v2.txt
259         diff -rup .v0.txt .v2.txt   # assert no types added
260
261 check-md-html-dir: $(PROGRAM)
262         rm -Rf Test/html.actual
263         $(MONO) $(PROGRAM) export-html -dest:Test/html.actual $(DIR) 
264         diff --exclude=.svn -rup Test/html.expected Test/html.actual
265
266 check-mdoc-export-msxdoc-update:
267         $(MONO) $(PROGRAM) export-msxdoc -o - Test/en.expected.importslashdoc \
268                 > Test/msxdoc-expected.importslashdoc.xml
269
270 check-mdoc-export-msxdoc:
271         $(MONO) $(PROGRAM) export-msxdoc -o - Test/en.expected.importslashdoc \
272                 | diff --brief - Test/msxdoc-expected.importslashdoc.xml
273
274 my_abs_top_srcdir = $(shell cd . && pwd)
275
276 check-mdoc-validate-update: $(PROGRAM)
277         $(MONO) $(PROGRAM) validate -f ecma Test/en.expected 2>&1 | \
278                 sed 's#file://$(my_abs_top_srcdir)/##g' > \
279                 Test/validate.check.monodocer
280         $(MONO) $(PROGRAM) validate -f ecma Test/en.expected.importslashdoc 2>&1 | \
281                 sed 's#file://$(my_abs_top_srcdir)/##g' > \
282                 Test/validate.check.monodocer.importslashdoc
283         $(MONO) $(PROGRAM) validate -f ecma Test/en.expected.since 2>&1 | \
284                 sed 's#file://$(my_abs_top_srcdir)/##g' > \
285                 Test/validate.check.monodocer.since
286
287 check-mdoc-validate: $(PROGRAM)
288         $(MONO) $(PROGRAM) validate -f ecma Test/en.expected 2>&1 | \
289                 sed 's#file://$(my_abs_top_srcdir)/##g' | \
290                 diff - Test/validate.check.monodocer
291         $(MONO) $(PROGRAM) validate -f ecma Test/en.expected.importslashdoc 2>&1 | \
292                 sed 's#file://$(my_abs_top_srcdir)/##g' | \
293                 diff --brief - Test/validate.check.monodocer.importslashdoc
294         $(MONO) $(PROGRAM) validate -f ecma Test/en.expected.since 2>&1 | \
295                 sed 's#file://$(my_abs_top_srcdir)/##g' | \
296                 diff --brief - Test/validate.check.monodocer.since
297
298 run-test-local: check-doc-tools
299
300 run-test-update : check-doc-tools-update
301
302 check-doc-tools: check-monodocer-since \
303         check-monodocer-importecmadoc \
304         check-monodocer-importslashdoc \
305         check-monodocer \
306         check-monodocer-delete \
307         check-mdoc-export-html \
308         check-mdoc-export-html-with-version \
309         check-mdoc-export-msxdoc \
310         check-mdoc-validate
311
312 check-doc-tools-update: check-monodocer-since-update \
313         check-monodocer-importecmadoc-update \
314         check-monodocer-importslashdoc-update \
315         check-monodocer-update \
316         check-monodocer-dropns-classic \
317         check-monodocer-dropns-classic-withsecondary \
318         check-monodocer-internal-interface \
319         check-monodocer-delete-update \
320         check-mdoc-export-html-update \
321         check-mdoc-export-msxdoc-update \
322         check-mdoc-validate-update 
323
324