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 \
211 local-propagation.c \
240 test_sources2 = generics.2.cs il2tests.2.il
242 if MONO_DEBUGGER_SUPPORTED
243 mono_debugger_sources = debug-debugger.c debug-debugger.h
245 mono_debugger_sources =
248 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
249 regtests2=generics.exe il2tests.exe
251 common_BURGSRC= $(srcdir)/inssel.brg $(srcdir)/inssel-float.brg
255 $(x86_sources) $(mono_debugger_sources)
256 arch_BURGSRC= $(srcdir)/inssel-long32.brg $(srcdir)/inssel-x86.brg
262 $(amd64_sources) $(mono_debugger_sources)
263 arch_BURGSRC= $(srcdir)/inssel-long.brg $(srcdir)/inssel-amd64.brg
264 arch_built=cpu-amd64.h
270 arch_BURGSRC= $(srcdir)/inssel-long32.brg $(srcdir)/inssel-ppc.brg
275 arch_sources = $(mips_sources)
276 arch_BURGSRC= $(srcdir)/inssel-long32-mips.brg $(srcdir)/inssel-mips.brg
277 arch_built=cpu-mips.h
282 # pick up arm_dpimacros.h and arm_fpamacros.h
283 ARCH_CFLAGS = -I../arch/arm
285 arch_sources = $(arm_sources)
287 arch_BURGSRC= $(srcdir)/inssel-long32.brg $(srcdir)/inssel-arm.brg $(srcdir)/inssel-softfloat.brg
295 arch_BURGSRC= $(srcdir)/inssel-long32.brg $(srcdir)/inssel-sparc.brg
296 arch_built=cpu-sparc.h
303 arch_BURGSRC= $(srcdir)/inssel-long.brg $(srcdir)/inssel-sparc.brg
304 arch_built=cpu-sparc.h
311 arch_BURGSRC= $(srcdir)/inssel-long32.brg $(srcdir)/inssel-s390.brg
312 arch_built=cpu-s390.h
319 arch_BURGSRC= $(srcdir)/inssel-long.brg $(srcdir)/inssel-s390x.brg
320 arch_built=cpu-s390x.h
327 arch_BURGSRC = $(srcdir)/inssel-long.brg $(srcdir)/inssel-ia64.brg
328 arch_built = cpu-ia64.h
335 arch_BURGSRC = $(srcdir)/inssel-long.brg $(srcdir)/inssel-alpha.brg
336 arch_built = cpu-alpha.h
339 libmono_la_SOURCES = $(common_sources) $(arch_sources)
341 nodist_libmono_la_SOURCES = inssel.c inssel.h
343 libmono_static_la_SOURCES = $(libmono_la_SOURCES)
344 nodist_libmono_static_la_SOURCES = $(nodist_libmono_la_SOURCES)
345 libmono_static_la_LDFLAGS = -static
346 libmono_static_la_LIBADD = $(static_libs)
348 BURGSRC= $(common_BURGSRC) $(arch_BURGSRC)
350 libmonoincludedir = $(includedir)/mono/jit
352 libmonoinclude_HEADERS = jit.h
354 libmono_la_LIBADD = \
357 %.exe: %.2.cs TestDriver.dll
358 $(GMCS) -out:$@ $< -r:TestDriver.dll
360 %.exe: %.cs TestDriver.dll
361 $(MCS) -out:$@ -unsafe $< -r:TestDriver.dll
364 $(ILASM2) -output=$@ $<
367 $(ILASM) -output=$@ $<
369 TestDriver.dll: $(srcdir)/TestDriver.cs
370 $(MCS) -out:$@ -target:library $<
374 cpu-x86.h: cpu-x86.md
375 cpu-amd64.h: cpu-amd64.md
377 cpu-arm.h: cpu-arm.md
378 cpu-sparc.h: cpu-sparc.md
379 cpu-s390.h: cpu-s390.md
380 cpu-s390x.h: cpu-s390x.md
381 cpu-ia64.h: cpu-ia64.md
382 cpu-alpha.h: cpu-alpha.md
383 cpu-mips.h: cpu-mips.md
385 ## Gross hack. Making 'genmdesc' a host binary takes more effort
387 echo "*** please build $(arch_built) on a native build tree and copy it here"
390 else !CROSS_COMPILING
392 cpu-x86.h: cpu-x86.md genmdesc$(EXEEXT)
393 ./genmdesc $(srcdir)/cpu-x86.md cpu-x86.h x86_desc
395 cpu-amd64.h: cpu-amd64.md genmdesc$(EXEEXT)
396 ./genmdesc $(srcdir)/cpu-amd64.md cpu-amd64.h amd64_desc
398 cpu-g4.h: cpu-g4.md genmdesc$(EXEEXT)
399 ./genmdesc $(srcdir)/cpu-g4.md cpu-g4.h ppcg4
401 cpu-arm.h: cpu-arm.md genmdesc$(EXEEXT)
402 ./genmdesc $(srcdir)/cpu-arm.md cpu-arm.h arm_cpu_desc
404 cpu-sparc.h: cpu-sparc.md genmdesc$(EXEEXT)
405 ./genmdesc $(srcdir)/cpu-sparc.md cpu-sparc.h sparc_desc
407 cpu-s390.h: cpu-s390.md genmdesc$(EXEEXT)
408 ./genmdesc $(srcdir)/cpu-s390.md cpu-s390.h s390_cpu_desc
410 cpu-s390x.h: cpu-s390x.md genmdesc$(EXEEXT)
411 ./genmdesc $(srcdir)/cpu-s390x.md cpu-s390x.h s390x_cpu_desc
413 cpu-ia64.h: cpu-ia64.md genmdesc$(EXEEXT)
414 ./genmdesc $(srcdir)/cpu-ia64.md cpu-ia64.h ia64_desc
416 cpu-alpha.h: cpu-alpha.md genmdesc$(EXEEXT)
417 ./genmdesc $(srcdir)/cpu-alpha.md cpu-alpha.h alpha_desc
419 cpu-mips.h: cpu-mips.md genmdesc$(EXEEXT)
420 ./genmdesc $(srcdir)/cpu-mips.md cpu-mips.h mips_desc
422 endif !CROSS_COMPILING
424 inssel.c inssel.h: $(BURGSRC)
425 $(monodir)/mono/monoburg/monoburg -c 1 -p -e $(BURGSRC) -d inssel.h -s inssel.c
428 $(RUNTIME) -v -v --ncompile 1 --compile Test:$(mtest) test.exe
430 # ensure the tests are actually correct
431 checktests: $(regtests)
432 for i in $(regtests); do $(RUNTIME) $$i; done
434 checktests2: $(regtests2)
435 for i in $(regtests); do $(RUNTIME2) $$i; done
437 rcheck: mono $(regtests) $(regtests2)
438 $(RUNTIME) --regression $(regtests)
439 $(RUNTIME2) --regression $(regtests2)
441 aotcheck: mono $(regtests)
442 for i in $(regtests); do $(RUNTIME) --aot $$i; done
443 # for i in $(regtests2); do $(RUNTIME2) --aot $$i; done
444 $(RUNTIME) --regression $(regtests)
445 # $(RUNTIME2) --verbose --regression $(regtests2)
449 time env $(RUNTIME) --ncompile $(count) --compile Test:$(mtest) test.exe
452 time $(monodir)/mono/jit/mono --ncompile $(count) --compile Test:$(mtest) test.exe
454 stat1: mono bench.exe
455 $(RUNTIME) --verbose --statfile stats.pl --regression bench.exe
456 perl viewstat.pl stats.pl
458 stat2: mono basic.exe
459 $(RUNTIME) --verbose --statfile stats.pl --regression basic.exe
460 perl viewstat.pl -e stats.pl
462 stat3: mono bench.exe
463 $(RUNTIME) --statfile stats.pl --ncompile 1000 --compile Tests:test_0_many_nested_loops bench.exe
464 perl viewstat.pl stats.pl
472 rm -f mono a.out gmon.out *.o test.exe
474 pkgconfigdir = $(libdir)/pkgconfig
477 BUILT_SOURCES= inssel.c inssel.h $(arch_built)
480 CLEANFILES= $(BUILT_SOURCES) *.exe *.dll
481 EXTRA_DIST = $(common_BURGSRC) cprop.c TestDriver.cs ldscript ldscript.mono \
482 $(test_sources) $(test_sources2) \
483 inssel-long.brg inssel-long32.brg \
484 inssel-softfloat.brg \
485 $(x86_sources) inssel-x86.brg cpu-x86.md \
486 $(amd64_sources) inssel-amd64.brg cpu-amd64.md \
487 $(ppc_sources) inssel-ppc.brg cpu-g4.md \
488 $(arm_sources) inssel-arm.brg cpu-arm.md \
489 $(sparc_sources) inssel-sparc.brg cpu-sparc.md \
490 $(s390_sources) inssel-s390.brg cpu-s390.md \
491 $(s390x_sources) inssel-s390x.brg cpu-s390x.md \
492 $(ia64_sources) inssel-ia64.brg cpu-ia64.md \
493 $(alpha_sources) inssel-alpha.brg cpu-alpha.md