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/io-layer/libwapi.la \
17 $(monodir)/mono/utils/libmonoutils.la \
23 $(monodir)/mono/metadata/libmonoruntime-static.la \
24 $(monodir)/mono/io-layer/libwapi.la \
25 $(monodir)/mono/utils/libmonoutils.la \
30 CLASS1=$(mcs_topdir)/class/lib/default
31 CLASS2=$(mcs_topdir)/class/lib/net_2_0
33 RUNTIME = MONO_PATH=$(CLASS1) $(top_builddir)/runtime/mono-wrapper
34 RUNTIME2 = MONO_PATH=$(CLASS2) $(top_builddir)/runtime/mono-wrapper
36 MCS = $(RUNTIME) $(CLASS1)/mcs.exe -unsafe -nowarn:0162
37 GMCS = $(RUNTIME2) $(CLASS2)/gmcs.exe -unsafe -nowarn:0162
38 ILASM = $(RUNTIME) $(CLASS1)/ilasm.exe
39 ILASM2 = $(RUNTIME2) $(CLASS2)/ilasm.exe
46 $(PLATFORM_CFLAGS) $(ARCH_CFLAGS)
50 # The mingw math.h has "extern inline" functions that dont appear in libs, so
51 # optimisation is required to actually inline them
55 # hack for automake to have the same source file in a library and a bin
56 genmdesc_CFLAGS = $(AM_CFLAGS)
62 monoldflags=-Wl,-version-script=$(srcdir)/ldscript
63 monobinldflags=-Wl,-version-script=$(srcdir)/ldscript.mono
67 libmono_la_LDFLAGS=-no-undefined -avoid-version $(monoldflags)
69 libmono_la_LDFLAGS=$(monoldflags)
75 bin_PROGRAMS = mono monow
80 noinst_PROGRAMS = genmdesc
82 lib_LTLIBRARIES = libmono.la
83 noinst_LTLIBRARIES = libmono-static.la
90 # Link libmono into mono statically
91 # This leads to higher performance, especially with TLS
92 MONO_LIB=libmono-static.la
103 $(static_flags) -export-dynamic $(monobinldflags)
105 # Create monow.exe, linked for the 'windows' subsystem
107 monow_LDADD = $(mono_LDADD)
108 monow_LDFLAGS = $(mono_LDFLAGS) -mwindows
109 monow_SOURCES = $(mono_SOURCES)
117 # Don't link this against libmonoruntime to speed up rebuilds
119 $(monodir)/mono/utils/libmonoutils.la $(monodir)/mono/metadata/opcodes.lo -lm \
212 local-propagation.c \
241 test_sources2 = generics.2.cs il2tests.2.il
243 if MONO_DEBUGGER_SUPPORTED
245 mono_debugger_arch_sources = mdb-debug-info64.s
248 mono_debugger_arch_sources = mdb-debug-info64.s
250 mono_debugger_arch_sources = mdb-debug-info32.s
253 mono_debugger_sources = debug-debugger.c debug-debugger.h $(mono_debugger_arch_sources)
255 mono_debugger_sources =
258 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
259 regtests2=generics.exe il2tests.exe
261 common_BURGSRC= $(srcdir)/inssel.brg $(srcdir)/inssel-float.brg
265 $(x86_sources) $(mono_debugger_sources)
266 arch_BURGSRC= $(srcdir)/inssel-long32.brg $(srcdir)/inssel-x86.brg
272 $(amd64_sources) $(mono_debugger_sources)
273 arch_BURGSRC= $(srcdir)/inssel-long.brg $(srcdir)/inssel-amd64.brg
274 arch_built=cpu-amd64.h
280 arch_BURGSRC= $(srcdir)/inssel-long32.brg $(srcdir)/inssel-ppc.brg
285 arch_sources = $(mips_sources)
286 arch_BURGSRC= $(srcdir)/inssel-long32-mips.brg $(srcdir)/inssel-mips.brg
287 arch_built=cpu-mips.h
292 # pick up arm_dpimacros.h and arm_fpamacros.h
293 ARCH_CFLAGS = -I../arch/arm
295 arch_sources = $(arm_sources)
297 arch_BURGSRC= $(srcdir)/inssel-long32.brg $(srcdir)/inssel-arm.brg $(srcdir)/inssel-softfloat.brg
305 arch_BURGSRC= $(srcdir)/inssel-long32.brg $(srcdir)/inssel-sparc.brg
306 arch_built=cpu-sparc.h
313 arch_BURGSRC= $(srcdir)/inssel-long.brg $(srcdir)/inssel-sparc.brg
314 arch_built=cpu-sparc.h
321 arch_BURGSRC= $(srcdir)/inssel-long32.brg $(srcdir)/inssel-s390.brg
322 arch_built=cpu-s390.h
329 arch_BURGSRC= $(srcdir)/inssel-long.brg $(srcdir)/inssel-s390x.brg
330 arch_built=cpu-s390x.h
337 arch_BURGSRC = $(srcdir)/inssel-long.brg $(srcdir)/inssel-ia64.brg
338 arch_built = cpu-ia64.h
343 $(alpha_sources) $(mono_debugger_sources)
345 arch_BURGSRC = $(srcdir)/inssel-long.brg $(srcdir)/inssel-alpha.brg
346 arch_built = cpu-alpha.h
349 libmono_la_SOURCES = $(common_sources) $(arch_sources)
351 nodist_libmono_la_SOURCES = inssel.c inssel.h
353 libmono_static_la_SOURCES = $(libmono_la_SOURCES)
354 nodist_libmono_static_la_SOURCES = $(nodist_libmono_la_SOURCES)
355 libmono_static_la_LDFLAGS = -static
356 libmono_static_la_LIBADD = $(static_libs)
358 BURGSRC= $(common_BURGSRC) $(arch_BURGSRC)
360 libmonoincludedir = $(includedir)/mono-$(API_VER)/mono/jit
362 libmonoinclude_HEADERS = jit.h
364 libmono_la_LIBADD = \
367 %.exe: %.2.cs TestDriver.dll
368 $(GMCS) -out:$@ $< -r:TestDriver.dll
370 %.exe: %.cs TestDriver.dll
371 $(MCS) -out:$@ -unsafe $< -r:TestDriver.dll
374 $(ILASM2) -output=$@ $<
377 $(ILASM) -output=$@ $<
379 TestDriver.dll: $(srcdir)/TestDriver.cs
380 $(MCS) -out:$@ -target:library $<
384 cpu-x86.h: cpu-x86.md
385 cpu-amd64.h: cpu-amd64.md
387 cpu-arm.h: cpu-arm.md
388 cpu-sparc.h: cpu-sparc.md
389 cpu-s390.h: cpu-s390.md
390 cpu-s390x.h: cpu-s390x.md
391 cpu-ia64.h: cpu-ia64.md
392 cpu-alpha.h: cpu-alpha.md
393 cpu-mips.h: cpu-mips.md
395 ## Gross hack. Making 'genmdesc' a host binary takes more effort
397 echo "*** please build $(arch_built) on a native build tree and copy it here"
400 else !CROSS_COMPILING
402 cpu-x86.h: cpu-x86.md genmdesc$(EXEEXT)
403 ./genmdesc $(srcdir)/cpu-x86.md cpu-x86.h x86_desc
405 cpu-amd64.h: cpu-amd64.md genmdesc$(EXEEXT)
406 ./genmdesc $(srcdir)/cpu-amd64.md cpu-amd64.h amd64_desc
408 cpu-g4.h: cpu-g4.md genmdesc$(EXEEXT)
409 ./genmdesc $(srcdir)/cpu-g4.md cpu-g4.h ppcg4
411 cpu-arm.h: cpu-arm.md genmdesc$(EXEEXT)
412 ./genmdesc $(srcdir)/cpu-arm.md cpu-arm.h arm_cpu_desc
414 cpu-sparc.h: cpu-sparc.md genmdesc$(EXEEXT)
415 ./genmdesc $(srcdir)/cpu-sparc.md cpu-sparc.h sparc_desc
417 cpu-s390.h: cpu-s390.md genmdesc$(EXEEXT)
418 ./genmdesc $(srcdir)/cpu-s390.md cpu-s390.h s390_cpu_desc
420 cpu-s390x.h: cpu-s390x.md genmdesc$(EXEEXT)
421 ./genmdesc $(srcdir)/cpu-s390x.md cpu-s390x.h s390x_cpu_desc
423 cpu-ia64.h: cpu-ia64.md genmdesc$(EXEEXT)
424 ./genmdesc $(srcdir)/cpu-ia64.md cpu-ia64.h ia64_desc
426 cpu-alpha.h: cpu-alpha.md genmdesc$(EXEEXT)
427 ./genmdesc $(srcdir)/cpu-alpha.md cpu-alpha.h alpha_desc
429 cpu-mips.h: cpu-mips.md genmdesc$(EXEEXT)
430 ./genmdesc $(srcdir)/cpu-mips.md cpu-mips.h mips_desc
432 endif !CROSS_COMPILING
434 inssel.c inssel.h: $(BURGSRC)
435 $(monodir)/mono/monoburg/monoburg -c 1 -p -e $(BURGSRC) -d inssel.h -s inssel.c
438 $(RUNTIME) -v -v --ncompile 1 --compile Test:$(mtest) test.exe
440 # ensure the tests are actually correct
441 checktests: $(regtests)
442 for i in $(regtests); do $(RUNTIME) $$i; done
444 checktests2: $(regtests2)
445 for i in $(regtests); do $(RUNTIME2) $$i; done
447 rcheck: mono $(regtests) $(regtests2)
448 $(RUNTIME) --regression $(regtests)
449 $(RUNTIME2) --regression $(regtests2)
451 aotcheck: mono $(regtests)
452 for i in $(regtests); do $(RUNTIME) --aot $$i; done
453 # for i in $(regtests2); do $(RUNTIME2) --aot $$i; done
454 $(RUNTIME) --regression $(regtests)
455 # $(RUNTIME2) --verbose --regression $(regtests2)
459 time env $(RUNTIME) --ncompile $(count) --compile Test:$(mtest) test.exe
462 time $(monodir)/mono/jit/mono --ncompile $(count) --compile Test:$(mtest) test.exe
464 stat1: mono bench.exe
465 $(RUNTIME) --verbose --statfile stats.pl --regression bench.exe
466 perl viewstat.pl stats.pl
468 stat2: mono basic.exe
469 $(RUNTIME) --verbose --statfile stats.pl --regression basic.exe
470 perl viewstat.pl -e stats.pl
472 stat3: mono bench.exe
473 $(RUNTIME) --statfile stats.pl --ncompile 1000 --compile Tests:test_0_many_nested_loops bench.exe
474 perl viewstat.pl stats.pl
482 rm -f mono a.out gmon.out *.o test.exe
484 pkgconfigdir = $(libdir)/pkgconfig
487 BUILT_SOURCES= inssel.c inssel.h $(arch_built)
490 CLEANFILES= $(BUILT_SOURCES) *.exe *.dll
491 EXTRA_DIST = $(common_BURGSRC) cprop.c TestDriver.cs ldscript ldscript.mono \
492 $(test_sources) $(test_sources2) \
493 inssel-long.brg inssel-long32.brg \
494 inssel-softfloat.brg \
495 $(x86_sources) inssel-x86.brg cpu-x86.md \
496 $(amd64_sources) inssel-amd64.brg cpu-amd64.md \
497 $(ppc_sources) inssel-ppc.brg cpu-g4.md \
498 $(arm_sources) inssel-arm.brg cpu-arm.md \
499 $(mips_sources) inssel-mips.brg inssel-long32-mips.brg cpu-mips.md \
500 $(sparc_sources) inssel-sparc.brg cpu-sparc.md \
501 $(s390_sources) inssel-s390.brg cpu-s390.md \
502 $(s390x_sources) inssel-s390x.brg cpu-s390x.md \
503 $(ia64_sources) inssel-ia64.brg cpu-ia64.md \
504 $(alpha_sources) inssel-alpha.brg cpu-alpha.md