3 include ../../build/rules.make
5 # corlib is crazy to build so we skip build/library.make and do stuff
8 # Here, we define a bunch of variables.
10 corlib = $(topdir)/class/lib/corlib.dll
11 testlib = corlib_test.dll
12 cmplib = $(topdir)/class/lib/corlib_cmp.dll
14 corpdb = $(patsubst %.dll,%.pdb,$(corlib))
15 testpdb = $(patsubst %.dll,%.pdb,$(testlib))
16 cmppdb = $(patsubst %.dll,%.pdb,$(cmplib))
18 sourcefile = corlib.dll.sources
19 response = $(depsdir)/corlib.dll.response
20 makefrag = $(depsdir)/corlib.dll.makefrag
21 stampfile = $(depsdir)/corlib.dll.stamp
22 # disable, until people fix their code...
23 #corlib_flags = /unsafe /nostdlib /d:INSIDE_CORLIB
24 corlib_flags = /unsafe /nostdlib
26 test_sourcefile = corlib_test.dll.sources
27 test_response = $(depsdir)/$(testlib).response
28 test_makefrag = $(depsdir)/$(testlib).makefrag
29 test_stampfile = $(depsdir)/$(testlib).stamp
30 test_flags = /nowarn:0618 /nowarn:0672 /r:$(corlib) /r:$(topdir)/class/lib/NUnit.Framework.dll
32 cmp_response = $(depsdir)/corlib_cmp.dll.response
33 cmp_makefrag = $(depsdir)/corlib_cmp.dll.makefrag
34 cmp_stampfile = $(depsdir)/corlib_cmp.dll.stamp
35 cmp_flags = /r:$(PLATFORM_CORLIB) $(corlib_flags)
41 install-local: $(corlib)
42 $(MKINSTALLDIRS) $(DESTDIR)$(prefix)/lib
43 $(INSTALL_LIB) $(corlib) $(DESTDIR)$(prefix)/lib
46 -rm -f $(corlib) $(cmplib) $(testlib) TestResult.xml \
47 $(response) $(makefrag) $(stampfile) \
48 $(test_response) $(test_makefrag) $(test_stampfile) \
49 $(corpdb) $(cmppdb) $(testpdb) \
50 $(cmp_response) $(cmp_makefrag) $(cmp_stampfile)
53 test-local: $(corlib) $(testlib)
56 $(TEST_RUNTIME) $(TEST_HARNESS) $(testlib)
58 # OK, that was the easy part. Now we get to the fun bits.
62 DISTFILES = $(sourcefile) $(test_sourcefile) \
63 corlib.dll.win32-excludes corlib_cmp.dll.excludes Test/ms_run_test.sh
65 # see $(topdir)/build/library.make for explanation of what's going on
68 dist-local: dist-default
69 for f in `cat $(sourcefile)` `cat $(test_sourcefile) |sed -e 's,^\(.\),Test/\1,'` ; do \
70 dest=`dirname $(distdir)/$$f` ; \
71 $(MKINSTALLDIRS) $$dest && cp $$f $$dest || exit 1 ; \
76 $(corlib): $(makefrag) $(response) $(stampfile)
77 $(BOOT_COMPILE) $(LIBRARY_FLAGS) $(corlib_flags) /target:library /out:$@ @$(response)
79 $(response): $(sourcefile)
81 ifdef PLATFORM_CHANGE_SEPARATOR_CMD
82 @cat $< |$(PLATFORM_TWEAK_CORLIB_SOURCES) |$(PLATFORM_CHANGE_SEPARATOR_CMD) >$@
84 @cat $< |$(PLATFORM_TWEAK_CORLIB_SOURCES) >$@
87 $(makefrag): $(response)
89 @echo "HAVE_MAKEFRAG = yes" >$@.new
90 @echo "$(stampfile): \\" >>$@.new
91 @cat $< |sed -e 's,\.cs[ \t]*$$,\.cs \\,' >>$@.new
92 @cat $@.new |sed -e '$$s, \\$$,,' >$@
93 @$(ECHO_ESCAPE) "\ttouch \$$@" >>$@
105 $(cmplib): $(cmp_makefrag) $(cmp_response) $(cmp_stampfile)
106 $(BOOT_COMPILE) $(LIBRARY_FLAGS) $(cmp_flags) /target:library /out:$@ @$(cmp_response)
108 $(cmp_response): $(response) corlib_cmp.dll.excludes
109 @echo Creating $@ ...
110 ifdef PLATFORM_CHANGE_SEPARATOR_CMD
111 @cat corlib_cmp.dll.excludes |$(PLATFORM_CHANGE_SEPARATOR_CMD) |cat - $< |sort |uniq -u >$@
113 @cat corlib_cmp.dll.excludes |cat - $< |sort |uniq -u >$@
116 $(cmp_makefrag): $(cmp_response)
117 @echo Creating $@ ...
118 @echo "HAVE_CMP_MAKEFRAG = yes" >$@.new
119 @echo "$(cmp_stampfile): \\" >>$@.new
120 @cat $< |sed -e 's,\.cs[ \t]*$$,\.cs \\,' >>$@.new
121 @cat $@.new |sed -e '$$s, \\$$,,' >$@
122 @$(ECHO_ESCAPE) "\ttouch \$$@" >>$@
125 # Since we make corlib_cmp on demand, there isn't a real need
126 # to have full dep tracking for it. Also, the generation of this
127 # file is busted on Win32 ('sort' seems to mess up line endings),
128 # leading to a broken build.
130 # -include $(cmp_makefrag)
132 ifndef HAVE_CMP_MAKEFRAG
139 $(testlib): $(test_makefrag) $(test_response) $(test_stampfile)
140 $(CSCOMPILE) $(test_flags) /target:library /out:$@ @$(test_response)
142 $(test_response): $(test_sourcefile)
143 @echo Creating $@ ...
144 ifdef PLATFORM_CHANGE_SEPARATOR_CMD
145 @cat $< |sed -e 's,^\(.\),Test/\1,' |$(PLATFORM_CHANGE_SEPARATOR_CMD) >$@
147 @cat $< |sed -e 's,^\(.\),Test/\1,' >$@
150 $(test_makefrag): $(test_response)
151 @echo Creating $@ ...
152 @echo "HAVE_TEST_MAKEFRAG = yes" >$@.new
153 @echo "$(test_stampfile): \\" >>$@.new
154 @cat $< |sed -e 's,\.cs[ \t]*$$,\.cs \\,' >>$@.new
155 @cat $@.new |sed -e '$$s, \\$$,,' >$@
156 @$(ECHO_ESCAPE) "\ttouch \$$@" >>$@
159 -include $(test_makefrag)
161 ifndef HAVE_TEST_MAKEFRAG