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 = MONO_PATH=$(mcs_topdir)/class/lib/default MONO_SHARED_DIR=$(mono_build_root)/runtime ./mono --config $(top_builddir)/data/config
36 MCS = $(RUNTIME) $(mcs_topdir)/class/lib/default/mcs.exe --unsafe -nowarn:0162
37 ILASM = $(RUNTIME) $(mcs_topdir)/ilasm/ilasm.exe
47 # The mingw math.h has "extern inline" functions that dont appear in libs, so
48 # optimisation is required to actually inline them
52 # hack for automake to have the same source file in a library and a bin
53 genmdesc_CFLAGS = $(AM_CFLAGS)
58 monoldflags=-Wl,-version-script=$(srcdir)/ldscript
62 libmono_la_LDFLAGS=-no-undefined -version-info 1:0:0 $(monoldflags)
64 libmono_la_LDFLAGS=$(monoldflags)
70 noinst_PROGRAMS = genmdesc
72 lib_LTLIBRARIES = libmono.la
73 noinst_LTLIBRARIES = libmono-static.la
80 # Link libmono into mono statically
81 # This leads to higher performance, especially with TLS
82 MONO_LIB=libmono-static.la
94 $(static_flags) -export-dynamic $(monoldflags)
101 # Don't link this against libmetadata to speed up rebuilds
103 $(monodir)/mono/utils/libmonoutils.la $(monodir)/mono/metadata/opcodes.lo -lm \
186 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
188 common_BURGSRC= $(srcdir)/inssel.brg $(srcdir)/inssel-float.brg
191 libmono_la_SOURCES = \
192 $(common_sources) $(x86_sources)
194 arch_BURGSRC= $(srcdir)/inssel-long32.brg $(srcdir)/inssel-x86.brg
195 arch_built=cpu-pentium.h
199 libmono_la_SOURCES = \
200 $(common_sources) $(amd64_sources)
201 arch_BURGSRC= $(srcdir)/inssel-long.brg $(srcdir)/inssel-amd64.brg
202 arch_built=cpu-amd64.h
206 libmono_la_SOURCES = \
207 $(common_sources) $(ppc_sources)
209 arch_BURGSRC= $(srcdir)/inssel-long32.brg $(srcdir)/inssel-ppc.brg
214 libmono_la_SOURCES = \
215 $(common_sources) $(sparc_sources)
217 arch_BURGSRC= $(srcdir)/inssel-long32.brg $(srcdir)/inssel-sparc.brg
218 arch_built=cpu-sparc.h
222 libmono_la_SOURCES = \
223 $(common_sources) $(sparc_sources)
225 arch_BURGSRC= $(srcdir)/inssel-long.brg $(srcdir)/inssel-sparc.brg
226 arch_built=cpu-sparc.h
230 libmono_la_SOURCES = \
231 $(common_sources) $(s390_sources)
233 arch_BURGSRC= $(srcdir)/inssel-long32.brg $(srcdir)/inssel-s390.brg
234 arch_built=cpu-s390.h
238 libmono_la_SOURCES = \
239 $(common_sources) $(s390x_sources)
241 arch_BURGSRC= $(srcdir)/inssel-long.brg $(srcdir)/inssel-s390x.brg
242 arch_built=cpu-s390x.h
245 nodist_libmono_la_SOURCES = inssel.c inssel.h
247 libmono_static_la_SOURCES = $(libmono_la_SOURCES)
248 nodist_libmono_static_la_SOURCES = $(nodist_libmono_la_SOURCES)
249 libmono_static_la_LDFLAGS = -static
250 libmono_static_la_LIBADD = $(static_libs)
252 BURGSRC= $(common_BURGSRC) $(arch_BURGSRC)
254 libmonoincludedir = $(includedir)/mono/jit
256 libmonoinclude_HEADERS = jit.h
258 libmono_la_LIBADD = \
261 %.exe: %.cs TestDriver.dll
262 $(MCS) /out:$*.exe /unsafe $< /r:TestDriver.dll
265 $(ILASM) /output=$*.exe $<
267 TestDriver.dll: $(srcdir)/TestDriver.cs
268 $(MCS) /out:TestDriver.dll /target:library $(srcdir)/TestDriver.cs
270 cpu-pentium.h: cpu-pentium.md genmdesc$(EXEEXT)
271 ./genmdesc $(srcdir)/cpu-pentium.md cpu-pentium.h pentium_desc
273 cpu-amd64.h: cpu-amd64.md genmdesc$(EXEEXT)
274 ./genmdesc $(srcdir)/cpu-amd64.md cpu-amd64.h amd64_desc
276 cpu-g4.h: cpu-g4.md genmdesc$(EXEEXT)
277 ./genmdesc $(srcdir)/cpu-g4.md cpu-g4.h ppcg4
279 cpu-sparc.h: cpu-sparc.md genmdesc$(EXEEXT)
280 ./genmdesc $(srcdir)/cpu-sparc.md cpu-sparc.h sparc_desc
282 cpu-s390.h: cpu-s390.md genmdesc$(EXEEXT)
283 ./genmdesc $(srcdir)/cpu-s390.md cpu-s390.h s390
285 cpu-s390x.h: cpu-s390x.md genmdesc$(EXEEXT)
286 ./genmdesc $(srcdir)/cpu-s390x.md cpu-s390x.h s390x
288 inssel.c inssel.h: $(BURGSRC)
289 $(monodir)/mono/monoburg/monoburg -c 1 -p -e $(BURGSRC) -d inssel.h -s inssel.c
292 $(RUNTIME) -v -v --ncompile 1 --compile Test:$(mtest) test.exe
294 # ensure the tests are actually correct
295 checktests: $(regtests)
296 for i in $(regtests); do $(RUNTIME) $$i; done
298 rcheck: mono $(regtests)
299 $(RUNTIME) --regression $(regtests)
301 aotcheck: mono $(regtests)
302 for i in $(regtests); do $(RUNTIME) --aot $$i; done
303 $(RUNTIME) --verbose --regression $(regtests)
307 time env $(RUNTIME) --ncompile $(count) --compile Test:$(mtest) test.exe
310 time $(monodir)/mono/jit/mono --ncompile $(count) --compile Test:$(mtest) test.exe
312 stat1: mono bench.exe
313 $(RUNTIME) --verbose --statfile stats.pl --regression bench.exe
314 perl viewstat.pl stats.pl
316 stat2: mono basic.exe
317 $(RUNTIME) --verbose --statfile stats.pl --regression basic.exe
318 perl viewstat.pl -e stats.pl
320 stat3: mono bench.exe
321 $(RUNTIME) --statfile stats.pl --ncompile 1000 --compile Tests:test_0_many_nested_loops bench.exe
322 perl viewstat.pl stats.pl
330 rm -f mono a.out gmon.out *.o test.exe
332 pkgconfigdir = $(libdir)/pkgconfig
335 BUILT_SOURCES= inssel.c inssel.h $(arch_built)
338 CLEANFILES= $(BUILT_SOURCES) *.exe *.dll
339 EXTRA_DIST = $(common_BURGSRC) jit-icalls.c cprop.c TestDriver.cs ldscript $(test_sources) \
340 inssel-long.brg inssel-long32.brg \
341 $(x86_sources) inssel-x86.brg cpu-pentium.md \
342 $(amd64_sources) inssel-amd64.brg cpu-amd64.md \
343 $(ppc_sources) inssel-ppc.brg cpu-g4.md \
344 $(sparc_sources) inssel-sparc.brg cpu-sparc.md \
345 $(s390_sources) inssel-s390.brg cpu-s390.md \
346 $(s390x_sources) inssel-s390x.brg cpu-s390x.md