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 corlib_flags = /unsafe /nostdlib
12 LOCAL_MCS_FLAGS = /nowarn:649 /nowarn:169 -d:INSIDE_CORLIB
15 LIBRARY_NAME = mscorlib.dll
16 LIB_MCS_FLAGS = $(corlib_flags)
17 LIBRARY_USE_INTERMEDIATE_FILE = yes
19 # disable, until people fix their code...
20 #corlib_flags = /unsafe /nostdlib /d:INSIDE_CORLIB
22 ifeq (net_2_0, $(PROFILE))
23 LIBRARY_INSTALL_DIR = $(prefix)/lib/mono/2.0
25 LIBRARY_INSTALL_DIR = $(prefix)/lib
28 CLEAN_FILES = $(cmplib) $(reslib) $(plattestlib) $(plattestlib).sources \
29 $(net20bootstrap_makefrag) \
30 $(cmp_response) $(cmp_makefrag) \
31 $(res_response) $(res_makefrag) \
32 $(cmppdb) $(respdb) $(plattestpdb)
34 # If building on a non mono-native platform, default
35 # to running the unit tests on its corlib, to see if
36 # our tests are complaint with their (hopefully bug-free)
37 # corlib. If on a mono-native platform, test our actual
40 # You can access either one on demand with either 'make
41 # run-monotest' or 'make run-plattest'.
43 plattestlib = corlib_plattest.dll
44 plattestpdb = $(patsubst %.dll,%.pdb,$(plattestlib))
45 reslib = $(topdir)/class/lib/$(PROFILE)/corlib_res.dll
46 cmplib = $(topdir)/class/lib/$(PROFILE)/corlib_cmp.dll
48 $(plattestlib).sources: corlib_test.dll.sources $(plattestlib).excludes
49 sort corlib_test.dll.sources $(plattestlib).excludes | uniq -u >$@
51 TEST_MCS_FLAGS = /debug+ /debug:full /nowarn:0618 /nowarn:0672 /unsafe
53 ifndef PLATFORM_MONO_NATIVE
54 test_lib = $(plattestlib)
55 test_against = $(PLATFORM_CORLIB)
56 HAVE_CS_TESTS = $(plattestlib).sources
58 ## for now, compiling the testsuite with CSC causes CS0583. So compile with internal MCS
59 TEST_COMPILE = $(INTERNAL_MCS) $(USE_MCS_FLAGS)
62 run-test-ondotnet-local: run-plattest-ondotnet
64 ifdef PLATFORM_MONO_NATIVE
65 run-monotest: run-test
69 $(MAKE) test_lib=corlib_test.dll test_against=$(reslib) run-test
72 $(MAKE) test_lib=$(plattestlib) test_against='$(PLATFORM_CORLIB)' run-test
75 run-plattest-ondotnet: $(plattestlib)
76 $(TEST_HARNESS) $(plattestlib)
79 corlib.dll.win32-excludes corlib_cmp.dll.excludes corlib_res.dll.excludes \
80 $(plattestlib).excludes \
83 ifeq (net_2_0, $(PROFILE))
84 # Net 2.0 corlib is built with in-tree 'gmcs'
85 LIBRARY_COMPILE = MONO_PATH="../lib/net_2_0_bootstrap$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(RUNTIME) $(gmcs) $(USE_MCS_FLAGS) /define:NET_1_1 /define:NET_2_0
87 LIBRARY_COMPILE = $(BOOT_COMPILE)
90 include ../../build/library.make
92 gmcs = $(topdir)/gmcs/gmcs.exe
93 net20bootstraplib = $(topdir)/class/lib/net_2_0_bootstrap/mscorlib.dll
95 ifeq (net_2_0, $(PROFILE))
98 # The in-tree 'gmcs' needs at least a stripped-down version of the net 2.0 corlib.dll. We build that first.
99 # make sure that $(gmcs) is up-to-date
101 $(gmcs): $(net20bootstraplib) FORCE
102 cd $(@D) && $(MAKE) $(@F)
106 net20bootstrap_makefrag = $(depsdir)/net_2_0_bootstrap_corlib.dll.makefrag
108 $(net20bootstraplib): $(net20bootstrap_makefrag) $(response)
109 $(BOOTSTRAP_MCS) $(LOCAL_MCS_FLAGS) /define:NET_1_1 /define:BOOTSTRAP_NET_2_0 $(corlib_flags) /target:library /out:$(net20bootstraplib) @$(response)
111 $(net20bootstrap_makefrag): $(response)
112 @echo Creating $@ ...
113 @sed 's,^,$(net20bootstraplib): ,' $< >$@
115 -include $(net20bootstrap_makefrag)
120 cmppdb = $(patsubst %.dll,%.pdb,$(cmplib))
121 cmp_response = $(depsdir)/$(PROFILE)_corlib_cmp.dll.response
122 cmp_makefrag = $(depsdir)/$(PROFILE)_corlib_cmp.dll.makefrag
123 cmp_flags = /r:$(PLATFORM_CORLIB) $(corlib_flags)
125 $(cmplib): $(cmp_makefrag) $(cmp_response)
126 $(BOOT_COMPILE) $(LIBRARY_FLAGS) $(cmp_flags) /target:library /out:$@ @$(cmp_response)
128 $(cmp_response): $(sourcefile) corlib_cmp.dll.excludes
129 @echo Creating $@ ...
130 @sort $(sourcefile) corlib_cmp.dll.excludes | uniq -u | $(PLATFORM_CHANGE_SEPARATOR_CMD) >$@
132 $(cmp_makefrag): $(cmp_response)
133 @echo Creating $@ ...
134 @sed 's,^,$(cmplib): ,' $< >$@
136 # Since we make corlib_cmp on demand, there isn't a real need
137 # to have full dep tracking for it. Also, the generation of this
138 # file is busted on Win32 ('sort' seems to mess up line endings),
139 # leading to a broken build.
141 # -include $(cmp_makefrag)
145 respdb = $(patsubst %.dll,%.pdb,$(reslib))
146 res_response = $(depsdir)/$(PROFILE)_corlib_res.dll.response
147 res_makefrag = $(depsdir)/$(PROFILE)_corlib_res.dll.makefrag
148 res_flags = /r:$(PLATFORM_CORLIB) $(corlib_flags)
150 $(reslib): $(res_makefrag) $(res_response)
151 $(BOOT_COMPILE) $(LIBRARY_FLAGS) $(res_flags) /target:library /out:$@ @$(res_response)
153 $(res_response): $(sourcefile) corlib_res.dll.excludes
154 @echo Creating $@ ...
155 @sort $(sourcefile) corlib_res.dll.excludes | uniq -u | $(PLATFORM_CHANGE_SEPARATOR_CMD) >$@
157 # warning: embedded tab in the 'echo touch' line
158 $(res_makefrag): $(res_response)
159 @echo Creating $@ ...
160 @sed 's,^,$(reslib): ,' $< >$@
162 -include $(res_makefrag)