* FloatingPointFormatter.cs: Made the class thread safe. Had to move some
[mono.git] / mcs / class / corlib / Makefile
1 thisdir = class/corlib
2 SUBDIRS =
3 include ../../build/rules.make
4 export __SECURITY_BOOTSTRAP_DB=$(topdir)/class/corlib
5
6 # corlib is crazy to build so we skip build/library.make and do stuff
7 # ourselves.
8 #
9 # Here, we define a bunch of variables.
10
11 ifdef PLATFORM_MONO_NATIVE
12 test_against = $(corlib)
13 else
14 test_against = $(reslib)
15 endif
16
17 LOCAL_MCS_FLAGS = /nowarn:649 /nowarn:169 -d:INSIDE_CORLIB
18
19 corlib = $(topdir)/class/lib/mscorlib.dll
20 testlib = corlib_test.dll
21 cmplib = $(topdir)/class/lib/corlib_cmp.dll
22 reslib = $(topdir)/class/lib/corlib_res.dll
23 plattestlib = corlib_plattest.dll
24
25 corpdb = $(patsubst %.dll,%.pdb,$(corlib))
26 testpdb = $(patsubst %.dll,%.pdb,$(testlib))
27 cmppdb = $(patsubst %.dll,%.pdb,$(cmplib))
28 respdb = $(patsubst %.dll,%.pdb,$(reslib))
29 plattestpdb = $(patsubst %.dll,%.pdb,$(plattestlib))
30
31 sourcefile = corlib.dll.sources
32 response = $(depsdir)/corlib.dll.response
33 makefrag = $(depsdir)/corlib.dll.makefrag
34 stampfile = $(depsdir)/corlib.dll.stamp
35 # disable, until people fix their code...
36 #corlib_flags = /unsafe /nostdlib /d:INSIDE_CORLIB
37 corlib_flags = /unsafe /nostdlib
38
39 test_sourcefile = corlib_test.dll.sources
40 test_response = $(depsdir)/$(testlib).response
41 test_makefrag = $(depsdir)/$(testlib).makefrag
42 test_stampfile = $(depsdir)/$(testlib).stamp
43 test_flags = /nowarn:0618 /nowarn:0672 /r:$(test_against) /r:$(topdir)/class/lib/NUnit.Framework.dll
44
45 cmp_response = $(depsdir)/corlib_cmp.dll.response
46 cmp_makefrag = $(depsdir)/corlib_cmp.dll.makefrag
47 cmp_stampfile = $(depsdir)/corlib_cmp.dll.stamp
48 cmp_flags = /r:$(PLATFORM_CORLIB) $(corlib_flags)
49
50 res_response = $(depsdir)/corlib_res.dll.response
51 res_makefrag = $(depsdir)/corlib_res.dll.makefrag
52 res_stampfile = $(depsdir)/corlib_res.dll.stamp
53 res_flags = /r:$(PLATFORM_CORLIB) $(corlib_flags)
54
55 plattest_excludes = corlib_plattest.dll.excludes
56 plattest_response = $(depsdir)/$(plattestlib).response
57 plattest_makefrag = $(depsdir)/$(plattestlib).makefrag
58 plattest_stampfile = $(depsdir)/$(plattestlib).stamp
59 plattest_flags = /debug+ /debug:full /nowarn:0618 /nowarn:0672 /r:$(PLATFORM_CORLIB) /r:$(topdir)/class/lib/NUnit.Framework.dll
60
61 # Here, we make all.
62
63 all-local: $(corlib)
64
65 install-local: $(corlib) $(makefrag)
66         $(MKINSTALLDIRS) $(DESTDIR)$(prefix)/lib
67         $(INSTALL_LIB) $(corlib) $(DESTDIR)$(prefix)/lib
68
69 uninstall-local:
70         -rm -f $(DESTDIR)$(prefix)/lib/corlib.dll
71
72 clean-local:
73         -rm -f $(corlib) $(cmplib) $(testlib) $(reslib) $(plattestlib) TestResult.xml \
74                $(response) $(makefrag) $(stampfile) \
75                $(test_response) $(test_makefrag) $(test_stampfile) \
76                $(cmp_response) $(cmp_makefrag) $(cmp_stampfile) \
77                $(res_response) $(res_makefrag) $(res_stampfile) \
78                $(plattest_response) $(plattest_makefrag) $(plattest_stampfile) \
79                $(corpdb) $(cmppdb) $(testpdb) $(respdb) $(plattestpdb)
80
81
82 # If building on a non mono-native platform, default
83 # to running the unit tests on its corlib, to see if
84 # our tests are complaint with their (hopefully bug-free)
85 # corlib. If on a mono-native platform, test our actual
86 # corlib.
87 #
88 # You can access either one on demand with either 'make
89 # run-monotest' or 'make run-plattest'.
90
91 ifdef PLATFORM_MONO_NATIVE
92 test-local: $(test_against) $(testlib)
93
94 run-test-local: run-monotest
95 else
96 test-local: $(plattestlib)
97
98 run-test-local: run-plattest
99 endif
100
101 run-monotest: $(test_against) $(testlib)
102         $(TEST_RUNTIME) $(TEST_HARNESS) $(testlib)
103
104 run-plattest: $(plattestlib)
105         $(TEST_RUNTIME) $(TEST_HARNESS) $(plattestlib)
106
107 # OK, that was the easy part. Now we get to the fun bits.
108 #
109 # first, make dist.
110
111 DISTFILES = $(sourcefile) $(test_sourcefile) \
112         corlib.dll.win32-excludes corlib_cmp.dll.excludes corlib_res.dll.excludes \
113         $(plattest_excludes) \
114         Test/ms_run_test.sh
115
116 # see $(topdir)/build/library.make for explanation of what's going on
117 # here.
118
119 dist-local: dist-default
120         for f in `cat $(sourcefile)` `cat $(test_sourcefile) |sed -e 's,^\(.\),Test/\1,'` ; do \
121             dest=`dirname $(distdir)/$$f` ; \
122             $(MKINSTALLDIRS) $$dest && cp $$f $$dest || exit 1 ; \
123         done
124
125 # plain ol corlib
126
127 $(corlib): $(makefrag) $(response) $(stampfile)
128         $(BOOT_COMPILE) $(LIBRARY_FLAGS) $(corlib_flags) /target:library /out:$@ @$(response)
129
130 $(response): $(sourcefile)
131         @echo Creating $@ ...
132 ifdef PLATFORM_CHANGE_SEPARATOR_CMD
133         @cat $< |$(PLATFORM_TWEAK_CORLIB_SOURCES) |$(PLATFORM_CHANGE_SEPARATOR_CMD) >$@
134 else
135         @cat $< |$(PLATFORM_TWEAK_CORLIB_SOURCES) >$@
136 endif
137
138 # warning: embedded tab in the 'echo touch' line
139 $(makefrag): $(response)
140         @echo Creating $@ ...
141         @echo "HAVE_MAKEFRAG = yes" >$@.new
142         @echo "$(stampfile): \\" >>$@.new
143         @cat $< |sed -e 's,\.cs[ \t]*$$,\.cs \\,' >>$@.new
144         @cat $@.new |sed -e '$$s, \\$$,,' >$@
145         @echo " touch \$$@" >>$@
146         @rm -rf $@.new
147
148 -include $(makefrag)
149
150 ifndef HAVE_MAKEFRAG
151 $(stampfile):
152         touch $@
153 endif
154
155 # corlib_cmp
156
157 $(cmplib): $(cmp_makefrag) $(cmp_response) $(cmp_stampfile)
158         $(BOOT_COMPILE) $(LIBRARY_FLAGS) $(cmp_flags) /target:library /out:$@ @$(cmp_response)
159
160 $(cmp_response): $(response) corlib_cmp.dll.excludes
161         @echo Creating $@ ...
162 ifdef PLATFORM_CHANGE_SEPARATOR_CMD
163         @cat corlib_cmp.dll.excludes |$(PLATFORM_CHANGE_SEPARATOR_CMD) |cat - $< |sort |uniq -u >$@
164 else
165         @cat corlib_cmp.dll.excludes |cat - $< |sort |uniq -u >$@
166 endif
167
168 # warning: embedded tab in the 'echo touch' line
169 $(cmp_makefrag): $(cmp_response)
170         @echo Creating $@ ...
171         @echo "HAVE_CMP_MAKEFRAG = yes" >$@.new
172         @echo "$(cmp_stampfile): \\" >>$@.new
173         @cat $< |sed -e 's,\.cs[ \t]*$$,\.cs \\,' >>$@.new
174         @cat $@.new |sed -e '$$s, \\$$,,' >$@
175         @echo " touch \$$@" >>$@
176         @rm -rf $@.new
177
178 # Since we make corlib_cmp on demand, there isn't a real need
179 # to have full dep tracking for it. Also, the generation of this
180 # file is busted on Win32 ('sort' seems to mess up line endings),
181 # leading to a broken build.
182 #
183 # -include $(cmp_makefrag)
184
185 ifndef HAVE_CMP_MAKEFRAG
186 $(cmp_stampfile):
187         touch $@
188 endif
189
190 # corlib_res
191
192 $(reslib): $(res_makefrag) $(res_response) $(res_stampfile)
193         $(BOOT_COMPILE) $(LIBRARY_FLAGS) $(res_flags) /target:library /out:$@ @$(res_response)
194
195 $(res_response): $(sourcefile) corlib_res.dll.excludes
196         @echo Creating $@ ...
197 ifdef PLATFORM_CHANGE_SEPARATOR_CMD
198         @cat corlib_res.dll.excludes $(sourcefile) |sort |uniq -u |$(PLATFORM_CHANGE_SEPARATOR_CMD) >$@
199 else
200         @cat corlib_res.dll.excludes $(sourcefile) |sort |uniq -u >$@
201 endif
202
203 # warning: embedded tab in the 'echo touch' line
204 $(res_makefrag): $(res_response)
205         @echo Creating $@ ...
206         @echo "HAVE_RES_MAKEFRAG = yes" >$@.new
207         @echo "$(res_stampfile): \\" >>$@.new
208         @cat $< |sed -e 's,\.cs[ \t]*$$,\.cs \\,' >>$@.new
209         @cat $@.new |sed -e '$$s, \\$$,,' >$@
210         @echo " touch \$$@" >>$@
211         @rm -rf $@.new
212
213 -include $(res_makefrag)
214
215 ifndef HAVE_RES_MAKEFRAG
216 $(res_stampfile):
217         touch $@
218 endif
219
220 # corlib_test
221
222 $(testlib): $(test_makefrag) $(test_response) $(test_stampfile)
223         $(CSCOMPILE) $(test_flags) /target:library /out:$@ @$(test_response)
224
225 $(test_response): $(test_sourcefile)
226         @echo Creating $@ ...
227 ifdef PLATFORM_CHANGE_SEPARATOR_CMD
228         @cat $< |sed -e 's,^\(.\),Test/\1,' |$(PLATFORM_CHANGE_SEPARATOR_CMD) >$@
229 else
230         @cat $< |sed -e 's,^\(.\),Test/\1,' >$@
231 endif
232
233 # warning: embedded tab in the 'echo touch' line
234 $(test_makefrag): $(test_response)
235         @echo Creating $@ ...
236         @echo "HAVE_TEST_MAKEFRAG = yes" >$@.new
237         @echo "$(test_stampfile): \\" >>$@.new
238         @cat $< |sed -e 's,\.cs[ \t]*$$,\.cs \\,' >>$@.new
239         @cat $@.new |sed -e '$$s, \\$$,,' >$@
240         @echo " touch \$$@" >>$@
241         @rm -rf $@.new
242
243 -include $(test_makefrag)
244
245 ifndef HAVE_TEST_MAKEFRAG
246 $(test_stampfile):
247         touch $@
248 endif
249
250 # corlib_plattest
251
252 $(plattestlib): $(plattest_makefrag) $(plattest_response) $(plattest_stampfile)
253         $(CSCOMPILE) $(plattest_flags) /target:library /out:$@ @$(plattest_response)
254
255 $(plattest_response): $(test_sourcefile) $(plattest_excludes)
256         @echo Creating $@ ...
257 ifdef PLATFORM_CHANGE_SEPARATOR_CMD
258 ifdef PLATFORM_MONO_NATIVE
259         @cat $(plattest_excludes) $(test_sourcefile) |sort |uniq -u |sed -e 's,^\(.\),Test/\1,' |$(PLATFORM_CHANGE_SEPARATOR_CMD) >$@
260 else
261         @cat $(test_sourcefile) |sort |uniq -u |sed -e 's,^\(.\),Test/\1,' |$(PLATFORM_CHANGE_SEPARATOR_CMD) >$@
262 endif
263 else
264 ifdef PLATFORM_MONO_NATIVE
265         @cat $(plattest_excludes) $(test_sourcefile) |sort |uniq -u |sed -e 's,^\(.\),Test/\1,' >$@
266 else
267         @cat $(test_sourcefile) |sort |uniq -u |sed -e 's,^\(.\),Test/\1,' >$@
268 endif
269 endif
270
271 # warning: embedded tab in the 'echo touch' line
272 $(plattest_makefrag): $(plattest_response)
273         @echo Creating $@ ...
274         @echo "HAVE_PLATTEST_MAKEFRAG = yes" >$@.new
275         @echo "$(plattest_stampfile): \\" >>$@.new
276         @cat $< |sed -e 's,\.cs[ \t]*$$,\.cs \\,' >>$@.new
277         @cat $@.new |sed -e '$$s, \\$$,,' >$@
278         @echo " touch \$$@" >>$@
279         @rm -rf $@.new
280
281 -include $(plattest_makefrag)
282
283 ifndef HAVE_PLATTEST_MAKEFRAG
284 $(plattest_stampfile):
285         touch $@
286 endif