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 \
22 $(monodir)/mono/metadata/libmonoruntime-static.la \
23 $(monodir)/mono/io-layer/libwapi.la \
24 $(monodir)/mono/utils/libmonoutils.la \
28 CLASS=$(mcs_topdir)/class/lib/net_2_0
30 RUNTIME = MONO_PATH=$(CLASS) $(top_builddir)/runtime/mono-wrapper
31 RUNTIME_AOTCHECK = MONO_PATH=$(CLASS):. $(top_builddir)/runtime/mono-wrapper
33 MCS = $(RUNTIME) $(CLASS)/gmcs.exe -unsafe -nowarn:0162
34 ILASM = $(RUNTIME) $(CLASS)/ilasm.exe
40 $(PLATFORM_CFLAGS) $(ARCH_CFLAGS)
44 # The mingw math.h has "extern inline" functions that dont appear in libs, so
45 # optimisation is required to actually inline them
49 # hack for automake to have the same source file in a library and a bin
50 genmdesc_CFLAGS = $(AM_CFLAGS)
53 monoldflags=$(export_ldflags)
54 monobinldflags=$(export_ldflags)
56 monoldflags=-Wl,-version-script=$(srcdir)/ldscript $(export_ldflags)
57 monobinldflags=-Wl,-version-script=$(srcdir)/ldscript.mono $(export_ldflags)
61 libmono_la_LDFLAGS=-no-undefined -avoid-version -Wl,--kill-at $(monoldflags)
63 libmono_la_LDFLAGS=$(monoldflags)
69 bin_PROGRAMS = mono monow
74 noinst_PROGRAMS = genmdesc
76 lib_LTLIBRARIES = libmono.la
77 noinst_LTLIBRARIES = libmono-static.la
84 LIBMONO_DTRACE_OBJECT = .libs/mono-dtrace.$(OBJEXT)
86 MONO_DTRACE_OBJECT = mono-dtrace.$(OBJEXT)
92 LIBMONO_DTRACE_OBJECT =
96 # Link libmono into mono statically
97 # This leads to higher performance, especially with TLS
98 MONO_LIB=libmono-static.la
107 $(MONO_DTRACE_OBJECT)
110 $(static_flags) -export-dynamic $(monobinldflags)
114 mono-dtrace.$(OBJEXT): $(top_srcdir)/data/mono.d mini.lo $(monodir)/mono/metadata/libmonoruntime-static.la
115 DTRACE="$(DTRACE)" DTRACEFLAGS="$(DTRACEFLAGS)" AR="$(AR)" $(SHELL) $(top_srcdir)/dtrace-prelink.sh \
116 $@ $(top_srcdir)/data/mono.d $(monodir)/mono/metadata/libmonoruntime-static.la mini.lo
118 .libs/mono-dtrace.$(OBJEXT): $(top_srcdir)/data/mono.d mini.lo $(monodir)/mono/metadata/libmonoruntime.la
119 DTRACE="$(DTRACE)" DTRACEFLAGS="$(DTRACEFLAGS)" AR="$(AR)" $(SHELL) $(top_srcdir)/dtrace-prelink.sh \
120 --pic $@ $(top_srcdir)/data/mono.d $(monodir)/mono/metadata/libmonoruntime.la mini.lo
124 # Create monow.exe, linked for the 'windows' subsystem
126 monow_LDADD = $(mono_LDADD)
127 monow_LDFLAGS = $(mono_LDFLAGS) -mwindows
128 monow_SOURCES = $(mono_SOURCES)
136 # Don't link this against libmonoruntime to speed up rebuilds
138 $(monodir)/mono/utils/libmonoutils.la $(monodir)/mono/metadata/opcodes.lo -lm \
235 local-propagation.c \
269 devirtualization.cs \
273 generics-variant-types.il \
276 if MONO_DEBUGGER_SUPPORTED
278 mono_debugger_arch_sources = mdb-debug-info64.s
281 mono_debugger_arch_sources = mdb-debug-info32.s
284 mono_debugger_sources = debug-debugger.c debug-debugger.h $(mono_debugger_arch_sources)
286 mono_debugger_sources =
289 regtests=basic.exe basic-float.exe basic-long.exe basic-calls.exe objects.exe arrays.exe basic-math.exe exceptions.exe iltests.exe devirtualization.exe generics.exe basic-simd.exe
291 common_BURGSRC= $(srcdir)/inssel.brg $(srcdir)/inssel-float.brg
294 arch_sources = $(x86_sources) $(mono_debugger_sources)
295 arch_BURGSRC= $(srcdir)/inssel-long32.brg $(srcdir)/inssel-x86.brg
301 arch_sources = $(amd64_sources) $(mono_debugger_sources)
302 arch_BURGSRC= $(srcdir)/inssel-long.brg $(srcdir)/inssel-amd64.brg
303 arch_built=cpu-amd64.h
304 arch_define=__x86_64__
308 arch_sources = $(ppc_sources)
309 arch_BURGSRC= $(srcdir)/inssel-long32.brg $(srcdir)/inssel-ppc.brg
315 arch_sources = $(ppc_sources)
316 arch_BURGSRC= $(srcdir)/inssel-long.brg $(srcdir)/inssel-ppc.brg
317 arch_built=cpu-ppc64.h
322 arch_sources = $(mips_sources)
323 arch_BURGSRC= $(srcdir)/inssel-long32-mips.brg $(srcdir)/inssel-mips.brg
324 arch_built=cpu-mips.h
329 # pick up arm_dpimacros.h and arm_fpamacros.h
330 ARCH_CFLAGS = -I../arch/arm
331 arch_sources = $(arm_sources)
332 arch_BURGSRC= $(srcdir)/inssel-long32.brg $(srcdir)/inssel-arm.brg $(srcdir)/inssel-softfloat.brg
338 arch_sources = $(sparc_sources)
339 arch_BURGSRC= $(srcdir)/inssel-long32.brg $(srcdir)/inssel-sparc.brg
340 arch_built=cpu-sparc.h
341 arch_define=__sparc__
345 arch_sources = $(sparc_sources)
346 arch_BURGSRC= $(srcdir)/inssel-long.brg $(srcdir)/inssel-sparc.brg
347 arch_built=cpu-sparc.h
348 arch_define=__sparc__
352 arch_sources = $(s390_sources)
353 arch_BURGSRC= $(srcdir)/inssel-long32.brg $(srcdir)/inssel-s390.brg
354 arch_built=cpu-s390.h
359 arch_sources = $(s390x_sources)
360 arch_BURGSRC= $(srcdir)/inssel-long.brg $(srcdir)/inssel-s390x.brg
361 arch_built=cpu-s390x.h
366 arch_sources = $(ia64_sources)
367 arch_BURGSRC = $(srcdir)/inssel-long.brg $(srcdir)/inssel-ia64.brg
368 arch_built = cpu-ia64.h
373 arch_sources = $(alpha_sources) $(mono_debugger_sources)
374 arch_BURGSRC = $(srcdir)/inssel-long.brg $(srcdir)/inssel-alpha.brg
375 arch_built = cpu-alpha.h
376 arch_define=__alpha__
380 # Only support 32-bit targets for now
381 arch_sources = $(hppa_sources)
382 arch_BURGSRC = $(srcdir)/inssel-long32.brg $(srcdir)/inssel-hppa.brg
383 arch_built = cpu-hppa.h
387 libmono_la_SOURCES = $(common_sources) $(arch_sources)
390 nodist_libmono_la_SOURCES = inssel.h
392 nodist_libmono_la_SOURCES = inssel.c inssel.h
395 libmono_static_la_SOURCES = $(libmono_la_SOURCES)
396 nodist_libmono_static_la_SOURCES = $(nodist_libmono_la_SOURCES)
397 libmono_static_la_LDFLAGS = -static
398 libmono_static_la_LIBADD = $(static_libs) $(MONO_DTRACE_OBJECT)
400 BURGSRC= $(common_BURGSRC) $(arch_BURGSRC)
402 libmonoincludedir = $(includedir)/mono-$(API_VER)/mono/jit
404 libmonoinclude_HEADERS = jit.h
406 libmono_la_LIBADD = \
407 $(libs) $(LIBMONO_DTRACE_OBJECT)
409 basic-simd.exe: basic-simd.cs
410 $(MCS) -out:$@ $< -r:TestDriver.dll -r:Mono.Simd.dll
412 generics.exe: generics.cs TestDriver.dll generics-variant-types.dll
413 $(MCS) -out:$@ $< -r:TestDriver.dll -r:generics-variant-types.dll
415 %.exe: %.cs TestDriver.dll
416 $(MCS) -out:$@ -unsafe $< -r:TestDriver.dll
418 iltests.il: iltests.il.in Makefile.am
419 echo '// DO NOT EDIT: This file has been generated from iltests.il.in' > iltests.il
420 cpp -Darch=$(arch_define) < $(srcdir)/iltests.il.in | sed 's/^#.*//' >> iltests.il
423 $(ILASM) -output=$@ $<
425 TestDriver.dll: $(srcdir)/TestDriver.cs
426 $(MCS) -out:$@ -target:library $<
428 generics-variant-types.dll: generics-variant-types.il
429 $(ILASM) -dll -output=$@ $<
431 # we don't always use the perl impl because it's an additional
432 # build dependency for the poor windows users
433 # $(arch_define) is the preprocessor symbol that enables all the opcodes
434 # for the specific platform in mini-ops.h
436 GENMDESC_PRG=perl $(srcdir)/genmdesc.pl $(arch_define) $(srcdir)
437 else !CROSS_COMPILING
438 GENMDESC_PRG=./genmdesc
439 endif !CROSS_COMPILING
441 cpu-x86.h: cpu-x86.md genmdesc$(EXEEXT)
442 $(GENMDESC_PRG) $(srcdir)/cpu-x86.md cpu-x86.h x86_desc
444 cpu-amd64.h: cpu-amd64.md genmdesc$(EXEEXT)
445 $(GENMDESC_PRG) $(srcdir)/cpu-amd64.md cpu-amd64.h amd64_desc
447 cpu-ppc.h: cpu-ppc.md genmdesc$(EXEEXT)
448 $(GENMDESC_PRG) $(srcdir)/cpu-ppc.md cpu-ppc.h ppcg4
450 cpu-ppc64.h: cpu-ppc64.md genmdesc$(EXEEXT)
451 $(GENMDESC_PRG) $(srcdir)/cpu-ppc64.md cpu-ppc64.h ppcg4
453 cpu-arm.h: cpu-arm.md genmdesc$(EXEEXT)
454 $(GENMDESC_PRG) $(srcdir)/cpu-arm.md cpu-arm.h arm_cpu_desc
456 cpu-sparc.h: cpu-sparc.md genmdesc$(EXEEXT)
457 $(GENMDESC_PRG) $(srcdir)/cpu-sparc.md cpu-sparc.h sparc_desc
459 cpu-s390.h: cpu-s390.md genmdesc$(EXEEXT)
460 $(GENMDESC_PRG) $(srcdir)/cpu-s390.md cpu-s390.h s390_cpu_desc
462 cpu-s390x.h: cpu-s390x.md genmdesc$(EXEEXT)
463 $(GENMDESC_PRG) $(srcdir)/cpu-s390x.md cpu-s390x.h s390x_cpu_desc
465 cpu-ia64.h: cpu-ia64.md genmdesc$(EXEEXT)
466 $(GENMDESC_PRG) $(srcdir)/cpu-ia64.md cpu-ia64.h ia64_desc
468 cpu-alpha.h: cpu-alpha.md genmdesc$(EXEEXT)
469 $(GENMDESC_PRG) $(srcdir)/cpu-alpha.md cpu-alpha.h alpha_desc
471 cpu-hppa.h: cpu-hppa.md genmdesc$(EXEEXT)
472 $(GENMDESC_PRG) $(srcdir)/cpu-hppa.md cpu-hppa.h hppa_desc
474 cpu-mips.h: cpu-mips.md genmdesc$(EXEEXT)
475 $(GENMDESC_PRG) $(srcdir)/cpu-mips.md cpu-mips.h mips_desc
477 inssel.c inssel.h: $(BURGSRC)
478 $(monodir)/mono/monoburg/monoburg -c 1 -p -e $(BURGSRC) -d inssel.h -s inssel.c
481 $(RUNTIME) -v -v --ncompile 1 --compile Test:$(mtest) test.exe
483 # ensure the tests are actually correct
484 checktests: $(regtests)
485 for i in $(regtests); do $(RUNTIME) $$i; done
487 rcheck: mono $(regtests)
488 $(RUNTIME) --regression $(regtests)
490 aotcheck: mono $(regtests)
492 $(RUNTIME) --aot $(regtests) || exit 1
493 for i in $(regtests); do $(RUNTIME_AOTCHECK) --regression $$i || exit 1; done
497 time env $(RUNTIME) --ncompile $(count) --compile Test:$(mtest) test.exe
500 time $(monodir)/mono/jit/mono --ncompile $(count) --compile Test:$(mtest) test.exe
502 stat1: mono bench.exe
503 $(RUNTIME) --verbose --statfile stats.pl --regression bench.exe
504 perl viewstat.pl stats.pl
506 stat2: mono basic.exe
507 $(RUNTIME) --verbose --statfile stats.pl --regression basic.exe
508 perl viewstat.pl -e stats.pl
510 stat3: mono bench.exe
511 $(RUNTIME) --statfile stats.pl --ncompile 1000 --compile Tests:test_0_many_nested_loops bench.exe
512 perl viewstat.pl stats.pl
520 rm -f mono a.out gmon.out *.o test.exe
522 pkgconfigdir = $(libdir)/pkgconfig
525 BUILT_SOURCES = version.h inssel.c inssel.h $(arch_built)
527 BUILT_SOURCES = version.h
530 CLEANFILES= $(BUILT_SOURCES) *.exe *.dll
531 EXTRA_DIST = $(common_BURGSRC) cprop.c TestDriver.cs ldscript ldscript.mono \
534 inssel-long.brg inssel-long32.brg \
535 inssel-softfloat.brg \
536 $(x86_sources) inssel-x86.brg cpu-x86.md \
537 $(amd64_sources) inssel-amd64.brg cpu-amd64.md \
538 $(ppc_sources) inssel-ppc.brg cpu-ppc.md \
539 $(arm_sources) inssel-arm.brg cpu-arm.md \
540 $(mips_sources) inssel-mips.brg inssel-long32-mips.brg cpu-mips.md \
541 $(sparc_sources) inssel-sparc.brg cpu-sparc.md \
542 $(s390_sources) inssel-s390.brg cpu-s390.md \
543 $(s390x_sources) inssel-s390x.brg cpu-s390x.md \
544 $(ia64_sources) inssel-ia64.brg cpu-ia64.md \
545 $(alpha_sources) inssel-alpha.brg cpu-alpha.md \
546 $(hppa_sources) inssel-hppa.brg cpu-hppa.md
549 if test -d $(top_srcdir)/.git/svn; then svn_info='git svn info'; fi; \
550 if test -d $(srcdir)/.svn; then svn_info='svn info'; fi; \
551 if test -n "$$svn_info"; then \
553 LANG=C; export LANG; \
554 branch=`$$svn_info | grep URL | sed -e 's/.*source//' -e 's,mono/?$$,,'`; \
555 version=`$$svn_info | grep Revision | sed 's/.*: //'`; \
556 echo "#define FULL_VERSION \"$$branch r$$version\""; \
559 echo "#define FULL_VERSION \"tarball\""; \