3 include ../../build/rules.make
4 export __SECURITY_BOOTSTRAP_DB=$(topdir)/class/corlib
6 # corlib is crazy to build so we skip build/library.make and do stuff
9 # Here, we define a bunch of variables.
11 ifdef PLATFORM_MONO_NATIVE
12 test_against = $(corlib)
14 test_against = $(reslib)
17 LOCAL_MCS_FLAGS = /nowarn:649 /nowarn:169 -d:INSIDE_CORLIB
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
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))
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
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
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)
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)
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
65 install-local: $(corlib) $(makefrag)
66 $(MKINSTALLDIRS) $(DESTDIR)$(prefix)/lib
67 $(INSTALL_LIB) $(corlib) $(DESTDIR)$(prefix)/lib
70 -rm -f $(DESTDIR)$(prefix)/lib/corlib.dll
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)
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
88 # You can access either one on demand with either 'make
89 # run-monotest' or 'make run-plattest'.
91 ifdef PLATFORM_MONO_NATIVE
92 test-local: $(test_against) $(testlib)
94 run-test-local: run-monotest
96 test-local: $(plattestlib)
98 run-test-local: run-plattest
101 run-monotest: $(test_against) $(testlib)
102 $(TEST_RUNTIME) $(TEST_HARNESS) $(testlib)
104 run-plattest: $(plattestlib)
105 $(TEST_RUNTIME) $(TEST_HARNESS) $(plattestlib)
107 # OK, that was the easy part. Now we get to the fun bits.
111 DISTFILES = $(sourcefile) $(test_sourcefile) \
112 corlib.dll.win32-excludes corlib_cmp.dll.excludes corlib_res.dll.excludes \
113 $(plattest_excludes) \
116 # see $(topdir)/build/library.make for explanation of what's going on
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 ; \
127 $(corlib): $(makefrag) $(response) $(stampfile)
128 $(BOOT_COMPILE) $(LIBRARY_FLAGS) $(corlib_flags) /target:library /out:$@ @$(response)
130 $(response): $(sourcefile)
131 @echo Creating $@ ...
132 ifdef PLATFORM_CHANGE_SEPARATOR_CMD
133 @cat $< |$(PLATFORM_TWEAK_CORLIB_SOURCES) |$(PLATFORM_CHANGE_SEPARATOR_CMD) >$@
135 @cat $< |$(PLATFORM_TWEAK_CORLIB_SOURCES) >$@
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 \$$@" >>$@
157 $(cmplib): $(cmp_makefrag) $(cmp_response) $(cmp_stampfile)
158 $(BOOT_COMPILE) $(LIBRARY_FLAGS) $(cmp_flags) /target:library /out:$@ @$(cmp_response)
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 >$@
165 @cat corlib_cmp.dll.excludes |cat - $< |sort |uniq -u >$@
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 \$$@" >>$@
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.
183 # -include $(cmp_makefrag)
185 ifndef HAVE_CMP_MAKEFRAG
192 $(reslib): $(res_makefrag) $(res_response) $(res_stampfile)
193 $(BOOT_COMPILE) $(LIBRARY_FLAGS) $(res_flags) /target:library /out:$@ @$(res_response)
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) >$@
200 @cat corlib_res.dll.excludes $(sourcefile) |sort |uniq -u >$@
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 \$$@" >>$@
213 -include $(res_makefrag)
215 ifndef HAVE_RES_MAKEFRAG
222 $(testlib): $(test_makefrag) $(test_response) $(test_stampfile)
223 $(CSCOMPILE) $(test_flags) /target:library /out:$@ @$(test_response)
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) >$@
230 @cat $< |sed -e 's,^\(.\),Test/\1,' >$@
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 \$$@" >>$@
243 -include $(test_makefrag)
245 ifndef HAVE_TEST_MAKEFRAG
252 $(plattestlib): $(plattest_makefrag) $(plattest_response) $(plattest_stampfile)
253 $(CSCOMPILE) $(plattest_flags) /target:library /out:$@ @$(plattest_response)
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) >$@
261 @cat $(test_sourcefile) |sort |uniq -u |sed -e 's,^\(.\),Test/\1,' |$(PLATFORM_CHANGE_SEPARATOR_CMD) >$@
264 ifdef PLATFORM_MONO_NATIVE
265 @cat $(plattest_excludes) $(test_sourcefile) |sort |uniq -u |sed -e 's,^\(.\),Test/\1,' >$@
267 @cat $(test_sourcefile) |sort |uniq -u |sed -e 's,^\(.\),Test/\1,' >$@
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 \$$@" >>$@
281 -include $(plattest_makefrag)
283 ifndef HAVE_PLATTEST_MAKEFRAG
284 $(plattest_stampfile):