Welcome to mirror list, hosted at ThFree Co, Russian Federation.

Makefile « corlib « class « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 54cd9b2aa232ab6c4b69e02cc3faee1770f16ccd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
thisdir = class/corlib
SUBDIRS =
include ../../build/rules.make
export __SECURITY_BOOTSTRAP_DB=$(topdir)/class/corlib

# corlib is crazy to build so we skip build/library.make and do stuff
# ourselves.
#
# Here, we define a bunch of variables.

ifdef PLATFORM_MONO_NATIVE
test_against = $(corlib)
else
test_against = $(reslib)
endif

LOCAL_MCS_FLAGS = /nowarn:649 /nowarn:169 -d:INSIDE_CORLIB

corlib = $(topdir)/class/lib/$(PROFILE)/mscorlib.dll
testlib = corlib_test.dll
cmplib = $(topdir)/class/lib/$(PROFILE)/corlib_cmp.dll
reslib = $(topdir)/class/lib/$(PROFILE)/corlib_res.dll
plattestlib = corlib_plattest.dll

corpdb = $(patsubst %.dll,%.pdb,$(corlib))
testpdb = $(patsubst %.dll,%.pdb,$(testlib))
cmppdb = $(patsubst %.dll,%.pdb,$(cmplib))
respdb = $(patsubst %.dll,%.pdb,$(reslib))
plattestpdb = $(patsubst %.dll,%.pdb,$(plattestlib))

sourcefile = corlib.dll.sources
response = $(depsdir)/$(PROFILE)_corlib.dll.response
makefrag = $(depsdir)/$(PROFILE)_corlib.dll.makefrag
stampfile = $(depsdir)/$(PROFILE)_corlib.dll.stamp
# disable, until people fix their code...
#corlib_flags = /unsafe /nostdlib /d:INSIDE_CORLIB
corlib_flags = /unsafe /nostdlib

test_sourcefile = corlib_test.dll.sources
test_response = $(depsdir)/$(PROFILE)_$(testlib).response
test_makefrag = $(depsdir)/$(PROFILE)_$(testlib).makefrag
test_stampfile = $(depsdir)/$(PROFILE)_$(testlib).stamp
test_flags = /nowarn:0618 /nowarn:0672 /r:$(test_against) /r:$(topdir)/class/lib/NUnit.Framework.dll

cmp_response = $(depsdir)/$(PROFILE)_corlib_cmp.dll.response
cmp_makefrag = $(depsdir)/$(PROFILE)_corlib_cmp.dll.makefrag
cmp_stampfile = $(depsdir)/$(PROFILE)_corlib_cmp.dll.stamp
cmp_flags = /r:$(PLATFORM_CORLIB) $(corlib_flags)

res_response = $(depsdir)/$(PROFILE)_corlib_res.dll.response
res_makefrag = $(depsdir)/$(PROFILE)_corlib_res.dll.makefrag
res_stampfile = $(depsdir)/$(PROFILE)_corlib_res.dll.stamp
res_flags = /r:$(PLATFORM_CORLIB) $(corlib_flags)

plattest_excludes = corlib_plattest.dll.excludes
plattest_response = $(depsdir)/$(PROFILE)_$(plattestlib).response
plattest_makefrag = $(depsdir)/$(PROFILE)_$(plattestlib).makefrag
plattest_stampfile = $(depsdir)/$(PROFILE)_$(plattestlib).stamp
plattest_flags = /debug+ /debug:full /nowarn:0618 /nowarn:0672 /r:$(PLATFORM_CORLIB) /r:$(topdir)/class/lib/NUnit.Framework.dll

# Here, we make all.

all-local: $(corlib)

install-local: $(corlib) $(makefrag)
	$(MKINSTALLDIRS) $(DESTDIR)$(prefix)/lib
	$(INSTALL_LIB) $(corlib) $(DESTDIR)$(prefix)/lib

uninstall-local:
	-rm -f $(DESTDIR)$(prefix)/lib/corlib.dll

clean-local:
	-rm -f $(corlib) $(cmplib) $(testlib) $(reslib) $(plattestlib) TestResult.xml \
	       $(response) $(makefrag) $(stampfile) \
	       $(test_response) $(test_makefrag) $(test_stampfile) \
	       $(cmp_response) $(cmp_makefrag) $(cmp_stampfile) \
	       $(res_response) $(res_makefrag) $(res_stampfile) \
	       $(plattest_response) $(plattest_makefrag) $(plattest_stampfile) \
	       $(corpdb) $(cmppdb) $(testpdb) $(respdb) $(plattestpdb)


# If building on a non mono-native platform, default
# to running the unit tests on its corlib, to see if
# our tests are complaint with their (hopefully bug-free)
# corlib. If on a mono-native platform, test our actual
# corlib.
#
# You can access either one on demand with either 'make
# run-monotest' or 'make run-plattest'.

ifdef PLATFORM_MONO_NATIVE
test-local: $(test_against) $(testlib)

run-test-local: run-monotest
else
test-local: $(plattestlib)

run-test-local: run-plattest
endif

run-monotest: $(test_against) $(testlib)
	$(TEST_RUNTIME) $(TEST_HARNESS) $(testlib)

run-plattest: $(plattestlib)
	$(TEST_RUNTIME) $(TEST_HARNESS) $(plattestlib)

# OK, that was the easy part. Now we get to the fun bits.
#
# first, make dist.

DISTFILES = $(sourcefile) $(test_sourcefile) \
	corlib.dll.win32-excludes corlib_cmp.dll.excludes corlib_res.dll.excludes \
	$(plattest_excludes) \
	Test/ms_run_test.sh

# see $(topdir)/build/library.make for explanation of what's going on
# here.

dist-local: dist-default
	for f in `cat $(sourcefile)` `cat $(test_sourcefile) |sed -e 's,^\(.\),Test/\1,'` ; do \
	    dest=`dirname $(distdir)/$$f` ; \
	    $(MKINSTALLDIRS) $$dest && cp $$f $$dest || exit 1 ; \
	done

# plain ol corlib

$(corlib): $(makefrag) $(response) $(stampfile)
	$(BOOT_COMPILE) $(LIBRARY_FLAGS) $(corlib_flags) /target:library /out:$@ @$(response)

$(response): $(sourcefile)
	@echo Creating $@ ...
ifdef PLATFORM_CHANGE_SEPARATOR_CMD
	@cat $< |$(PLATFORM_TWEAK_CORLIB_SOURCES) |$(PLATFORM_CHANGE_SEPARATOR_CMD) >$@
else
	@cat $< |$(PLATFORM_TWEAK_CORLIB_SOURCES) >$@
endif

# warning: embedded tab in the 'echo touch' line
$(makefrag): $(response)
	@echo Creating $@ ...
	@echo "HAVE_MAKEFRAG = yes" >$@.new
	@echo "$(stampfile): \\" >>$@.new
	@cat $< |sed -e 's,\.cs[ \t]*$$,\.cs \\,' >>$@.new
	@cat $@.new |sed -e '$$s, \\$$,,' >$@
	@echo "	touch \$$@" >>$@
	@rm -rf $@.new

-include $(makefrag)

ifndef HAVE_MAKEFRAG
$(stampfile):
	touch $@
endif

# corlib_cmp

$(cmplib): $(cmp_makefrag) $(cmp_response) $(cmp_stampfile)
	$(BOOT_COMPILE) $(LIBRARY_FLAGS) $(cmp_flags) /target:library /out:$@ @$(cmp_response)

$(cmp_response): $(response) corlib_cmp.dll.excludes
	@echo Creating $@ ...
ifdef PLATFORM_CHANGE_SEPARATOR_CMD
	@cat corlib_cmp.dll.excludes |$(PLATFORM_CHANGE_SEPARATOR_CMD) |cat - $< |sort |uniq -u >$@
else
	@cat corlib_cmp.dll.excludes |cat - $< |sort |uniq -u >$@
endif

# warning: embedded tab in the 'echo touch' line
$(cmp_makefrag): $(cmp_response)
	@echo Creating $@ ...
	@echo "HAVE_CMP_MAKEFRAG = yes" >$@.new
	@echo "$(cmp_stampfile): \\" >>$@.new
	@cat $< |sed -e 's,\.cs[ \t]*$$,\.cs \\,' >>$@.new
	@cat $@.new |sed -e '$$s, \\$$,,' >$@
	@echo "	touch \$$@" >>$@
	@rm -rf $@.new

# Since we make corlib_cmp on demand, there isn't a real need
# to have full dep tracking for it. Also, the generation of this
# file is busted on Win32 ('sort' seems to mess up line endings),
# leading to a broken build.
#
# -include $(cmp_makefrag)

ifndef HAVE_CMP_MAKEFRAG
$(cmp_stampfile):
	touch $@
endif

# corlib_res

$(reslib): $(res_makefrag) $(res_response) $(res_stampfile)
	$(BOOT_COMPILE) $(LIBRARY_FLAGS) $(res_flags) /target:library /out:$@ @$(res_response)

$(res_response): $(sourcefile) corlib_res.dll.excludes
	@echo Creating $@ ...
ifdef PLATFORM_CHANGE_SEPARATOR_CMD
	@cat corlib_res.dll.excludes $(sourcefile) |sort |uniq -u |$(PLATFORM_CHANGE_SEPARATOR_CMD) >$@
else
	@cat corlib_res.dll.excludes $(sourcefile) |sort |uniq -u >$@
endif

# warning: embedded tab in the 'echo touch' line
$(res_makefrag): $(res_response)
	@echo Creating $@ ...
	@echo "HAVE_RES_MAKEFRAG = yes" >$@.new
	@echo "$(res_stampfile): \\" >>$@.new
	@cat $< |sed -e 's,\.cs[ \t]*$$,\.cs \\,' >>$@.new
	@cat $@.new |sed -e '$$s, \\$$,,' >$@
	@echo "	touch \$$@" >>$@
	@rm -rf $@.new

-include $(res_makefrag)

ifndef HAVE_RES_MAKEFRAG
$(res_stampfile):
	touch $@
endif

# corlib_test

$(testlib): $(test_makefrag) $(test_response) $(test_stampfile)
	$(CSCOMPILE) $(test_flags) /target:library /out:$@ @$(test_response)

$(test_response): $(test_sourcefile)
	@echo Creating $@ ...
ifdef PLATFORM_CHANGE_SEPARATOR_CMD
	@cat $< |sed -e 's,^\(.\),Test/\1,' |$(PLATFORM_CHANGE_SEPARATOR_CMD) >$@
else
	@cat $< |sed -e 's,^\(.\),Test/\1,' >$@
endif

# warning: embedded tab in the 'echo touch' line
$(test_makefrag): $(test_response)
	@echo Creating $@ ...
	@echo "HAVE_TEST_MAKEFRAG = yes" >$@.new
	@echo "$(test_stampfile): \\" >>$@.new
	@cat $< |sed -e 's,\.cs[ \t]*$$,\.cs \\,' >>$@.new
	@cat $@.new |sed -e '$$s, \\$$,,' >$@
	@echo "	touch \$$@" >>$@
	@rm -rf $@.new

-include $(test_makefrag)

ifndef HAVE_TEST_MAKEFRAG
$(test_stampfile):
	touch $@
endif

# corlib_plattest

$(plattestlib): $(plattest_makefrag) $(plattest_response) $(plattest_stampfile)
	$(CSCOMPILE) $(plattest_flags) /target:library /out:$@ @$(plattest_response)

$(plattest_response): $(test_sourcefile) $(plattest_excludes)
	@echo Creating $@ ...
ifdef PLATFORM_CHANGE_SEPARATOR_CMD
ifdef PLATFORM_MONO_NATIVE
	@cat $(plattest_excludes) $(test_sourcefile) |sort |uniq -u |sed -e 's,^\(.\),Test/\1,' |$(PLATFORM_CHANGE_SEPARATOR_CMD) >$@
else
	@cat $(test_sourcefile) |sort |uniq -u |sed -e 's,^\(.\),Test/\1,' |$(PLATFORM_CHANGE_SEPARATOR_CMD) >$@
endif
else
ifdef PLATFORM_MONO_NATIVE
	@cat $(plattest_excludes) $(test_sourcefile) |sort |uniq -u |sed -e 's,^\(.\),Test/\1,' >$@
else
	@cat $(test_sourcefile) |sort |uniq -u |sed -e 's,^\(.\),Test/\1,' >$@
endif
endif

# warning: embedded tab in the 'echo touch' line
$(plattest_makefrag): $(plattest_response)
	@echo Creating $@ ...
	@echo "HAVE_PLATTEST_MAKEFRAG = yes" >$@.new
	@echo "$(plattest_stampfile): \\" >>$@.new
	@cat $< |sed -e 's,\.cs[ \t]*$$,\.cs \\,' >>$@.new
	@cat $@.new |sed -e '$$s, \\$$,,' >$@
	@echo "	touch \$$@" >>$@
	@rm -rf $@.new

-include $(plattest_makefrag)

ifndef HAVE_PLATTEST_MAKEFRAG
$(plattest_stampfile):
	touch $@
endif