3 monodir=$(top_builddir)
5 # This is needed for automake dependency generation
7 libgc_libs=$(monodir)/libgc/libmonogc.la
8 libgc_static_libs=$(monodir)/libgc/libmonogc-static.la
10 libgc_libs=$(LIBGC_LIBS)
11 libgc_static_libs=$(LIBGC_STATIC_LIBS)
15 $(monodir)/mono/metadata/libmonoruntime.la \
16 $(monodir)/mono/metadata/libmetadata.la \
17 $(monodir)/mono/io-layer/libwapi.la \
18 $(monodir)/mono/utils/libmonoutils.la \
25 $(monodir)/mono/metadata/libmonoruntime-static.la \
26 $(monodir)/mono/metadata/libmetadata-static.la \
27 $(monodir)/mono/io-layer/libwapi.la \
28 $(monodir)/mono/utils/libmonoutils.la \
31 $(libgc_static_libs) \
34 RUNTIME = $(LIBTOOL) --mode=execute ./mono
35 MCS = MONO_PATH=$(top_srcdir)/runtime/net_1_1 $(RUNTIME) --config $(top_builddir)/data/config $(top_srcdir)/runtime/mcs.exe --unsafe -nowarn:0162
36 ILASM = MONO_PATH=$(top_srcdir)/runtime/net_1_1 $(RUNTIME) --config ../../data/config $(top_srcdir)/runtime/ilasm.exe
46 # The mingw math.h has "extern inline" functions that dont appear in libs, so
47 # optimisation is required to actually inline them
51 # hack for automake to have the same source file in a library and a bin
52 genmdesc_CFLAGS = $(AM_CFLAGS)
57 monoldflags=-Wl,-version-script=$(srcdir)/ldscript
61 libmono_la_LDFLAGS=-no-undefined -version-info 1:0:0 $(monoldflags)
63 libmono_la_LDFLAGS=$(monoldflags)
69 noinst_PROGRAMS = genmdesc
71 lib_LTLIBRARIES = libmono.la
72 noinst_LTLIBRARIES = libmono-static.la
79 # Link libmono into mono statically
80 # This leads to higher performance, especially with TLS
81 MONO_LIB=libmono-static.la
93 $(static_flags) -export-dynamic $(monoldflags)
100 # Don't link this against libmetadata to speed up rebuilds
102 $(monodir)/mono/utils/libmonoutils.la $(monodir)/mono/metadata/opcodes.lo -lm \
182 regtests=basic.exe arrays.exe basic-float.exe basic-math.exe basic-long.exe objects.exe basic-calls.exe iltests.exe exceptions.exe bench.exe
184 common_BURGSRC= $(srcdir)/inssel.brg $(srcdir)/inssel-float.brg
187 libmono_la_SOURCES = \
188 $(common_sources) $(x86_sources)
190 arch_BURGSRC= $(srcdir)/inssel-long32.brg $(srcdir)/inssel-x86.brg
191 arch_built=cpu-pentium.h
195 libmono_la_SOURCES = \
196 $(common_sources) $(amd64_sources)
197 arch_BURGSRC= $(srcdir)/inssel-long.brg $(srcdir)/inssel-amd64.brg
198 arch_built=cpu-amd64.h
202 libmono_la_SOURCES = \
203 $(common_sources) $(ppc_sources)
205 arch_BURGSRC= $(srcdir)/inssel-long32.brg $(srcdir)/inssel-ppc.brg
210 libmono_la_SOURCES = \
211 $(common_sources) $(sparc_sources)
213 arch_BURGSRC= $(srcdir)/inssel-long32.brg $(srcdir)/inssel-sparc.brg
214 arch_built=cpu-sparc.h
218 libmono_la_SOURCES = \
219 $(common_sources) $(sparc_sources)
221 arch_BURGSRC= $(srcdir)/inssel-long.brg $(srcdir)/inssel-sparc.brg
222 arch_built=cpu-sparc.h
226 libmono_la_SOURCES = \
227 $(common_sources) $(s390_sources)
229 arch_BURGSRC= $(srcdir)/inssel-long32.brg $(srcdir)/inssel-s390.brg
230 arch_built=cpu-s390.h
234 libmono_la_SOURCES = \
235 $(common_sources) $(s390x_sources)
237 arch_BURGSRC= $(srcdir)/inssel-long.brg $(srcdir)/inssel-s390x.brg
238 arch_built=cpu-s390x.h
241 nodist_libmono_la_SOURCES = inssel.c inssel.h
243 libmono_static_la_SOURCES = $(libmono_la_SOURCES)
244 nodist_libmono_static_la_SOURCES = $(nodist_libmono_la_SOURCES)
245 libmono_static_la_LDFLAGS = -static
246 libmono_static_la_LIBADD = $(static_libs)
248 BURGSRC= $(common_BURGSRC) $(arch_BURGSRC)
250 libmonoincludedir = $(includedir)/mono/jit
252 libmonoinclude_HEADERS = jit.h
254 libmono_la_LIBADD = \
257 %.exe: %.cs TestDriver.dll
258 $(MCS) /out:$*.exe /unsafe $< /r:TestDriver.dll
261 $(ILASM) /output=$*.exe $<
263 TestDriver.dll: $(srcdir)/TestDriver.cs
264 $(MCS) /out:TestDriver.dll /target:library $(srcdir)/TestDriver.cs
266 cpu-pentium.h: cpu-pentium.md genmdesc$(EXEEXT)
267 ./genmdesc $(srcdir)/cpu-pentium.md cpu-pentium.h pentium_desc
269 cpu-amd64.h: cpu-amd64.md genmdesc$(EXEEXT)
270 ./genmdesc $(srcdir)/cpu-amd64.md cpu-amd64.h amd64_desc
272 cpu-g4.h: cpu-g4.md genmdesc$(EXEEXT)
273 ./genmdesc $(srcdir)/cpu-g4.md cpu-g4.h ppcg4
275 cpu-sparc.h: cpu-sparc.md genmdesc$(EXEEXT)
276 ./genmdesc $(srcdir)/cpu-sparc.md cpu-sparc.h sparc_desc
278 cpu-s390.h: cpu-s390.md genmdesc$(EXEEXT)
279 ./genmdesc $(srcdir)/cpu-s390.md cpu-s390.h s390
281 cpu-s390x.h: cpu-s390x.md genmdesc$(EXEEXT)
282 ./genmdesc $(srcdir)/cpu-s390x.md cpu-s390x.h s390x
284 inssel.c inssel.h: $(BURGSRC)
285 $(monodir)/mono/monoburg/monoburg -c 1 -p -e $(BURGSRC) -d inssel.h -s inssel.c
288 ./mono -v -v --ncompile 1 --compile Test:$(mtest) test.exe
290 # ensure the tests are actually correct
291 checktests: $(regtests)
292 for i in $(regtests); do $(RUNTIME) $$i; done
294 rcheck: mono $(regtests)
295 ./mono --regression $(regtests)
297 aotcheck: mono $(regtests)
298 for i in $(regtests); do ./mono --aot $$i; done
299 ./mono --verbose --regression $(regtests)
303 time ./mono --ncompile $(count) --compile Test:$(mtest) test.exe
306 time $(monodir)/mono/jit/mono --ncompile $(count) --compile Test:$(mtest) test.exe
308 stat1: mono bench.exe
309 ./mono --verbose --statfile stats.pl --regression bench.exe
310 perl viewstat.pl stats.pl
312 stat2: mono basic.exe
313 ./mono --verbose --statfile stats.pl --regression basic.exe
314 perl viewstat.pl -e stats.pl
316 stat3: mono bench.exe
317 ./mono --statfile stats.pl --ncompile 1000 --compile Tests:test_0_many_nested_loops bench.exe
318 perl viewstat.pl stats.pl
326 rm -f mono a.out gmon.out *.o test.exe
328 pkgconfigdir = $(libdir)/pkgconfig
331 BUILT_SOURCES= inssel.c inssel.h $(arch_built)
334 CLEANFILES= $(BUILT_SOURCES)
335 EXTRA_DIST = $(common_BURGSRC) jit-icalls.c cprop.c TestDriver.cs ldscript $(test_sources) \
336 inssel-long.brg inssel-long32.brg \
337 $(x86_sources) inssel-x86.brg cpu-pentium.md \
338 $(amd64_sources) inssel-amd64.brg cpu-amd64.md \
339 $(ppc_sources) inssel-ppc.brg cpu-g4.md \
340 $(sparc_sources) inssel-sparc.brg cpu-sparc.md \
341 $(s390_sources) inssel-s390.brg cpu-s390.md \
342 $(s390x_sources) inssel-s390x.brg cpu-s390x.md