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) \
45 # The mingw math.h has "extern inline" functions that dont appear in libs, so
46 # optimisation is required to actually inline them
50 # hack for automake to have the same source file in a library and a bin
51 genmdesc_CFLAGS = $(AM_CFLAGS)
56 monoldflags=-Wl,-version-script=$(srcdir)/ldscript
60 libmono_la_LDFLAGS=-no-undefined -version-info 1:0:0 $(monoldflags)
62 libmono_la_LDFLAGS=$(monoldflags)
68 noinst_PROGRAMS = genmdesc
70 lib_LTLIBRARIES = libmono.la
71 noinst_LTLIBRARIES = libmono-static.la
78 # Link libmono into mono statically
79 # This leads to higher performance, especially with TLS
80 MONO_LIB=libmono-static.la
92 $(static_flags) -export-dynamic $(monoldflags)
99 # Don't link this against libmetadata to speed up rebuilds
101 $(monodir)/mono/utils/libmonoutils.la $(monodir)/mono/metadata/opcodes.lo -lm \
179 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
181 common_BURGSRC= $(srcdir)/inssel.brg $(srcdir)/inssel-float.brg
184 libmono_la_SOURCES = \
185 $(common_sources) $(x86_sources)
187 arch_BURGSRC= $(srcdir)/inssel-long32.brg $(srcdir)/inssel-x86.brg
188 arch_built=cpu-pentium.h
192 libmono_la_SOURCES = \
193 $(common_sources) $(amd64_sources)
194 arch_BURGSRC= $(srcdir)/inssel-long.brg $(srcdir)/inssel-amd64.brg
195 arch_built=cpu-amd64.h
199 libmono_la_SOURCES = \
200 $(common_sources) $(ppc_sources)
202 arch_BURGSRC= $(srcdir)/inssel-long32.brg $(srcdir)/inssel-ppc.brg
207 libmono_la_SOURCES = \
208 $(common_sources) $(sparc_sources)
210 arch_BURGSRC= $(srcdir)/inssel-long32.brg $(srcdir)/inssel-sparc.brg
211 arch_built=cpu-sparc.h
215 libmono_la_SOURCES = \
216 $(common_sources) $(sparc_sources)
218 arch_BURGSRC= $(srcdir)/inssel-long.brg $(srcdir)/inssel-sparc.brg
219 arch_built=cpu-sparc.h
223 libmono_la_SOURCES = \
224 $(common_sources) $(s390_sources)
226 arch_BURGSRC= $(srcdir)/inssel-long32.brg $(srcdir)/inssel-s390.brg
227 arch_built=cpu-s390.h
231 libmono_la_SOURCES = \
232 $(common_sources) $(s390x_sources)
234 arch_BURGSRC= $(srcdir)/inssel-long.brg $(srcdir)/inssel-s390x.brg
235 arch_built=cpu-s390x.h
238 nodist_libmono_la_SOURCES = inssel.c inssel.h
240 libmono_static_la_SOURCES = $(libmono_la_SOURCES)
241 nodist_libmono_static_la_SOURCES = $(nodist_libmono_la_SOURCES)
242 libmono_static_la_LDFLAGS = -static
243 libmono_static_la_LIBADD = $(static_libs)
245 BURGSRC= $(common_BURGSRC) $(arch_BURGSRC)
247 libmonoincludedir = $(includedir)/mono/jit
249 libmonoinclude_HEADERS = jit.h
251 libmono_la_LIBADD = \
254 %.exe: %.cs TestDriver.dll
255 $(MCS) /out:$*.exe /unsafe $< /r:TestDriver.dll
258 ilasm /output=$*.exe $<
260 TestDriver.dll: $(srcdir)/TestDriver.cs
261 $(MCS) /out:TestDriver.dll /target:library $(srcdir)/TestDriver.cs
263 cpu-pentium.h: cpu-pentium.md genmdesc$(EXEEXT)
264 ./genmdesc $(srcdir)/cpu-pentium.md cpu-pentium.h pentium_desc
266 cpu-amd64.h: cpu-amd64.md genmdesc$(EXEEXT)
267 ./genmdesc $(srcdir)/cpu-amd64.md cpu-amd64.h amd64_desc
269 cpu-g4.h: cpu-g4.md genmdesc$(EXEEXT)
270 ./genmdesc $(srcdir)/cpu-g4.md cpu-g4.h ppcg4
272 cpu-sparc.h: cpu-sparc.md genmdesc$(EXEEXT)
273 ./genmdesc $(srcdir)/cpu-sparc.md cpu-sparc.h sparc_desc
275 cpu-s390.h: cpu-s390.md genmdesc$(EXEEXT)
276 ./genmdesc $(srcdir)/cpu-s390.md cpu-s390.h s390
278 cpu-s390x.h: cpu-s390x.md genmdesc$(EXEEXT)
279 ./genmdesc $(srcdir)/cpu-s390x.md cpu-s390x.h s390x
281 inssel.c inssel.h: $(BURGSRC)
282 $(monodir)/mono/monoburg/monoburg -c 1 -p -e $(BURGSRC) -d inssel.h -s inssel.c
285 ./mono -v -v --ncompile 1 --compile Test:$(mtest) test.exe
287 # ensure the tests are actually correct
288 checktests: $(regtests)
289 for i in $(regtests); do $(RUNTIME) $$i; done
291 rcheck: mono $(regtests)
292 ./mono --regression $(regtests)
294 aotcheck: mono $(regtests)
295 for i in $(regtests); do ./mono --aot $$i; done
296 ./mono --verbose --regression $(regtests)
300 time ./mono --ncompile $(count) --compile Test:$(mtest) test.exe
303 time $(monodir)/mono/jit/mono --ncompile $(count) --compile Test:$(mtest) test.exe
305 stat1: mono bench.exe
306 ./mono --verbose --statfile stats.pl --regression bench.exe
307 perl viewstat.pl stats.pl
309 stat2: mono basic.exe
310 ./mono --verbose --statfile stats.pl --regression basic.exe
311 perl viewstat.pl -e stats.pl
313 stat3: mono bench.exe
314 ./mono --statfile stats.pl --ncompile 1000 --compile Tests:test_0_many_nested_loops bench.exe
315 perl viewstat.pl stats.pl
321 rm -f mono a.out gmon.out *.o test.exe
323 pkgconfigdir = $(libdir)/pkgconfig
326 BUILT_SOURCES= inssel.c inssel.h $(arch_built)
329 CLEANFILES= $(BUILT_SOURCES)
330 EXTRA_DIST = $(common_BURGSRC) jit-icalls.c cprop.c TestDriver.cs ldscript $(test_sources) \
331 inssel-long.brg inssel-long32.brg \
332 $(x86_sources) inssel-x86.brg cpu-pentium.md \
333 $(amd64_sources) inssel-amd64.brg cpu-amd64.md \
334 $(ppc_sources) inssel-ppc.brg cpu-g4.md \
335 $(sparc_sources) inssel-sparc.brg cpu-sparc.md \
336 $(s390_sources) inssel-s390.brg cpu-s390.md \
337 $(s390x_sources) inssel-s390x.brg cpu-s390x.md