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 $(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 # Link libmono into mono statically
85 # This leads to higher performance, especially with TLS
86 MONO_LIB=libmono-static.la
97 $(static_flags) -export-dynamic $(monobinldflags)
99 # Create monow.exe, linked for the 'windows' subsystem
101 monow_LDADD = $(mono_LDADD)
102 monow_LDFLAGS = $(mono_LDFLAGS) -mwindows
103 monow_SOURCES = $(mono_SOURCES)
111 # Don't link this against libmonoruntime to speed up rebuilds
113 $(monodir)/mono/utils/libmonoutils.la $(monodir)/mono/metadata/opcodes.lo -lm \
207 local-propagation.c \
236 devirtualization.cs \
240 generics-variant-types.il
242 if MONO_DEBUGGER_SUPPORTED
244 mono_debugger_arch_sources = mdb-debug-info64.s
247 mono_debugger_arch_sources = mdb-debug-info32.s
250 mono_debugger_sources = debug-debugger.c debug-debugger.h $(mono_debugger_arch_sources)
252 mono_debugger_sources =
255 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 bench.exe
257 common_BURGSRC= $(srcdir)/inssel.brg $(srcdir)/inssel-float.brg
260 arch_sources = $(x86_sources) $(mono_debugger_sources)
261 arch_BURGSRC= $(srcdir)/inssel-long32.brg $(srcdir)/inssel-x86.brg
267 arch_sources = $(amd64_sources) $(mono_debugger_sources)
268 arch_BURGSRC= $(srcdir)/inssel-long.brg $(srcdir)/inssel-amd64.brg
269 arch_built=cpu-amd64.h
270 arch_define=__x86_64__
274 arch_sources = $(ppc_sources)
275 arch_BURGSRC= $(srcdir)/inssel-long32.brg $(srcdir)/inssel-ppc.brg
281 arch_sources = $(mips_sources)
282 arch_BURGSRC= $(srcdir)/inssel-long32-mips.brg $(srcdir)/inssel-mips.brg
283 arch_built=cpu-mips.h
288 # pick up arm_dpimacros.h and arm_fpamacros.h
289 ARCH_CFLAGS = -I../arch/arm
290 arch_sources = $(arm_sources)
291 arch_BURGSRC= $(srcdir)/inssel-long32.brg $(srcdir)/inssel-arm.brg $(srcdir)/inssel-softfloat.brg
297 arch_sources = $(sparc_sources)
298 arch_BURGSRC= $(srcdir)/inssel-long32.brg $(srcdir)/inssel-sparc.brg
299 arch_built=cpu-sparc.h
300 arch_define=__sparc__
304 arch_sources = $(sparc_sources)
305 arch_BURGSRC= $(srcdir)/inssel-long.brg $(srcdir)/inssel-sparc.brg
306 arch_built=cpu-sparc.h
307 arch_define=__sparc__
311 arch_sources = $(s390_sources)
312 arch_BURGSRC= $(srcdir)/inssel-long32.brg $(srcdir)/inssel-s390.brg
313 arch_built=cpu-s390.h
318 arch_sources = $(s390x_sources)
319 arch_BURGSRC= $(srcdir)/inssel-long.brg $(srcdir)/inssel-s390x.brg
320 arch_built=cpu-s390x.h
325 arch_sources = $(ia64_sources)
326 arch_BURGSRC = $(srcdir)/inssel-long.brg $(srcdir)/inssel-ia64.brg
327 arch_built = cpu-ia64.h
332 arch_sources = $(alpha_sources) $(mono_debugger_sources)
333 arch_BURGSRC = $(srcdir)/inssel-long.brg $(srcdir)/inssel-alpha.brg
334 arch_built = cpu-alpha.h
335 arch_define=__alpha__
339 # Only support 32-bit targets for now
340 arch_sources = $(hppa_sources)
341 arch_BURGSRC = $(srcdir)/inssel-long32.brg $(srcdir)/inssel-hppa.brg
342 arch_built = cpu-hppa.h
346 libmono_la_SOURCES = $(common_sources) $(arch_sources)
348 nodist_libmono_la_SOURCES = inssel.c inssel.h
350 libmono_static_la_SOURCES = $(libmono_la_SOURCES)
351 nodist_libmono_static_la_SOURCES = $(nodist_libmono_la_SOURCES)
352 libmono_static_la_LDFLAGS = -static
353 libmono_static_la_LIBADD = $(static_libs)
355 BURGSRC= $(common_BURGSRC) $(arch_BURGSRC)
357 libmonoincludedir = $(includedir)/mono-$(API_VER)/mono/jit
359 libmonoinclude_HEADERS = jit.h
361 libmono_la_LIBADD = \
364 generics.exe: generics.cs TestDriver.dll generics-variant-types.dll
365 $(MCS) -out:$@ $< -r:TestDriver.dll -r:generics-variant-types.dll
367 %.exe: %.cs TestDriver.dll
368 $(MCS) -out:$@ -unsafe $< -r:TestDriver.dll
370 iltests.il: iltests.il.in Makefile.am
371 echo '// DO NOT EDIT: This file has been generated from iltests.il.in' > iltests.il
372 cpp -Darch=$(arch_define) < $(srcdir)/iltests.il.in | sed 's/^#.*//' >> iltests.il
375 $(ILASM) -output=$@ $<
377 TestDriver.dll: $(srcdir)/TestDriver.cs
378 $(MCS) -out:$@ -target:library $<
380 generics-variant-types.dll: generics-variant-types.il
381 $(ILASM) -dll -output=$@ $<
383 # we don't always use the perl impl because it's an additional
384 # build dependency for the poor windows users
385 # $(arch_define) is the preprocessor symbol that enables all the opcodes
386 # for the specific platform in mini-ops.h
388 GENMDESC_PRG=perl genmdesc.pl $(arch_define) $(srcdir)
389 else !CROSS_COMPILING
390 GENMDESC_PRG=./genmdesc
391 endif !CROSS_COMPILING
393 cpu-x86.h: cpu-x86.md genmdesc$(EXEEXT)
394 $(GENMDESC_PRG) $(srcdir)/cpu-x86.md cpu-x86.h x86_desc
396 cpu-amd64.h: cpu-amd64.md genmdesc$(EXEEXT)
397 $(GENMDESC_PRG) $(srcdir)/cpu-amd64.md cpu-amd64.h amd64_desc
399 cpu-ppc.h: cpu-ppc.md genmdesc$(EXEEXT)
400 $(GENMDESC_PRG) $(srcdir)/cpu-ppc.md cpu-ppc.h ppcg4
402 cpu-arm.h: cpu-arm.md genmdesc$(EXEEXT)
403 $(GENMDESC_PRG) $(srcdir)/cpu-arm.md cpu-arm.h arm_cpu_desc
405 cpu-sparc.h: cpu-sparc.md genmdesc$(EXEEXT)
406 $(GENMDESC_PRG) $(srcdir)/cpu-sparc.md cpu-sparc.h sparc_desc
408 cpu-s390.h: cpu-s390.md genmdesc$(EXEEXT)
409 $(GENMDESC_PRG) $(srcdir)/cpu-s390.md cpu-s390.h s390_cpu_desc
411 cpu-s390x.h: cpu-s390x.md genmdesc$(EXEEXT)
412 $(GENMDESC_PRG) $(srcdir)/cpu-s390x.md cpu-s390x.h s390x_cpu_desc
414 cpu-ia64.h: cpu-ia64.md genmdesc$(EXEEXT)
415 $(GENMDESC_PRG) $(srcdir)/cpu-ia64.md cpu-ia64.h ia64_desc
417 cpu-alpha.h: cpu-alpha.md genmdesc$(EXEEXT)
418 $(GENMDESC_PRG) $(srcdir)/cpu-alpha.md cpu-alpha.h alpha_desc
420 cpu-hppa.h: cpu-hppa.md genmdesc$(EXEEXT)
421 $(GENMDESC_PRG) $(srcdir)/cpu-hppa.md cpu-hppa.h hppa_desc
423 cpu-mips.h: cpu-mips.md genmdesc$(EXEEXT)
424 $(GENMDESC_PRG) $(srcdir)/cpu-mips.md cpu-mips.h mips_desc
426 inssel.c inssel.h: $(BURGSRC)
427 $(monodir)/mono/monoburg/monoburg -c 1 -p -e $(BURGSRC) -d inssel.h -s inssel.c
430 $(RUNTIME) -v -v --ncompile 1 --compile Test:$(mtest) test.exe
432 # ensure the tests are actually correct
433 checktests: $(regtests)
434 for i in $(regtests); do $(RUNTIME) $$i; done
436 rcheck: mono $(regtests)
437 $(RUNTIME) --regression $(regtests)
439 aotcheck: mono $(regtests)
440 for i in $(regtests); do $(RUNTIME) --aot $$i || exit 1; done
441 for i in $(regtests); do $(RUNTIME_AOTCHECK) --regression $$i || exit 1; done
445 time env $(RUNTIME) --ncompile $(count) --compile Test:$(mtest) test.exe
448 time $(monodir)/mono/jit/mono --ncompile $(count) --compile Test:$(mtest) test.exe
450 stat1: mono bench.exe
451 $(RUNTIME) --verbose --statfile stats.pl --regression bench.exe
452 perl viewstat.pl stats.pl
454 stat2: mono basic.exe
455 $(RUNTIME) --verbose --statfile stats.pl --regression basic.exe
456 perl viewstat.pl -e stats.pl
458 stat3: mono bench.exe
459 $(RUNTIME) --statfile stats.pl --ncompile 1000 --compile Tests:test_0_many_nested_loops bench.exe
460 perl viewstat.pl stats.pl
468 rm -f mono a.out gmon.out *.o test.exe
470 pkgconfigdir = $(libdir)/pkgconfig
473 BUILT_SOURCES = version.h inssel.c inssel.h $(arch_built)
475 BUILT_SOURCES = version.h
478 CLEANFILES= $(BUILT_SOURCES) *.exe *.dll
479 EXTRA_DIST = $(common_BURGSRC) cprop.c TestDriver.cs ldscript ldscript.mono \
482 inssel-long.brg inssel-long32.brg \
483 inssel-softfloat.brg \
484 $(x86_sources) inssel-x86.brg cpu-x86.md \
485 $(amd64_sources) inssel-amd64.brg cpu-amd64.md \
486 $(ppc_sources) inssel-ppc.brg cpu-ppc.md \
487 $(arm_sources) inssel-arm.brg cpu-arm.md \
488 $(mips_sources) inssel-mips.brg inssel-long32-mips.brg cpu-mips.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 \
494 $(hppa_sources) inssel-hppa.brg cpu-hppa.md
497 if test -d $(srcdir)/.svn; then \
501 branch=`svn info | grep URL | sed -e 's/.*source//' -e 's,mono/mono/mini,,'`; \
502 version=`svn info | grep Revision | sed 's/.*: //'`; \
503 echo "#define FULL_VERSION \"$$branch r$$version\""; \
506 echo "#define FULL_VERSION \"tarball\""; \