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 CLASS1=$(mcs_topdir)/class/lib/default
29 CLASS2=$(mcs_topdir)/class/lib/net_2_0
31 RUNTIME = MONO_PATH=$(CLASS1) $(top_builddir)/runtime/mono-wrapper
32 RUNTIME2 = MONO_PATH=$(CLASS2) $(top_builddir)/runtime/mono-wrapper
34 MCS = $(RUNTIME) $(CLASS1)/mcs.exe -unsafe -nowarn:0162
35 GMCS = $(RUNTIME2) $(CLASS2)/gmcs.exe -unsafe -nowarn:0162
36 ILASM = $(RUNTIME) $(CLASS1)/ilasm.exe
37 ILASM2 = $(RUNTIME2) $(CLASS2)/ilasm.exe
43 $(PLATFORM_CFLAGS) $(ARCH_CFLAGS)
47 # The mingw math.h has "extern inline" functions that dont appear in libs, so
48 # optimisation is required to actually inline them
52 # hack for automake to have the same source file in a library and a bin
53 genmdesc_CFLAGS = $(AM_CFLAGS)
56 monoldflags=$(export_ldflags)
57 monobinldflags=$(export_ldflags)
59 monoldflags=-Wl,-version-script=$(srcdir)/ldscript $(export_ldflags)
60 monobinldflags=-Wl,-version-script=$(srcdir)/ldscript.mono $(export_ldflags)
64 libmono_la_LDFLAGS=-no-undefined -avoid-version $(monoldflags)
66 libmono_la_LDFLAGS=$(monoldflags)
72 bin_PROGRAMS = mono monow
77 noinst_PROGRAMS = genmdesc
79 lib_LTLIBRARIES = libmono.la
80 noinst_LTLIBRARIES = libmono-static.la
87 # Link libmono into mono statically
88 # This leads to higher performance, especially with TLS
89 MONO_LIB=libmono-static.la
100 $(static_flags) -export-dynamic $(monobinldflags)
102 # Create monow.exe, linked for the 'windows' subsystem
104 monow_LDADD = $(mono_LDADD)
105 monow_LDFLAGS = $(mono_LDFLAGS) -mwindows
106 monow_SOURCES = $(mono_SOURCES)
114 # Don't link this against libmonoruntime to speed up rebuilds
116 $(monodir)/mono/utils/libmonoutils.la $(monodir)/mono/metadata/opcodes.lo -lm \
209 local-propagation.c \
238 test_sources2 = generics.2.cs il2tests.2.il
240 if MONO_DEBUGGER_SUPPORTED
242 mono_debugger_arch_sources = mdb-debug-info64.s
245 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 arrays.exe basic-float.exe basic-math.exe basic-long.exe objects.exe basic-calls.exe iltests.exe exceptions.exe bench.exe
256 regtests2=generics.exe il2tests.exe
258 common_BURGSRC= $(srcdir)/inssel.brg $(srcdir)/inssel-float.brg
261 arch_sources = $(x86_sources) $(mono_debugger_sources)
262 arch_BURGSRC= $(srcdir)/inssel-long32.brg $(srcdir)/inssel-x86.brg
268 arch_sources = $(amd64_sources) $(mono_debugger_sources)
269 arch_BURGSRC= $(srcdir)/inssel-long.brg $(srcdir)/inssel-amd64.brg
270 arch_built=cpu-amd64.h
271 arch_define=__x86_64__
275 arch_sources = $(ppc_sources)
276 arch_BURGSRC= $(srcdir)/inssel-long32.brg $(srcdir)/inssel-ppc.brg
282 arch_sources = $(mips_sources)
283 arch_BURGSRC= $(srcdir)/inssel-long32-mips.brg $(srcdir)/inssel-mips.brg
284 arch_built=cpu-mips.h
289 # pick up arm_dpimacros.h and arm_fpamacros.h
290 ARCH_CFLAGS = -I../arch/arm
291 arch_sources = $(arm_sources)
292 arch_BURGSRC= $(srcdir)/inssel-long32.brg $(srcdir)/inssel-arm.brg $(srcdir)/inssel-softfloat.brg
298 arch_sources = $(sparc_sources)
299 arch_BURGSRC= $(srcdir)/inssel-long32.brg $(srcdir)/inssel-sparc.brg
300 arch_built=cpu-sparc.h
301 arch_define=__sparc__
305 arch_sources = $(sparc_sources)
306 arch_BURGSRC= $(srcdir)/inssel-long.brg $(srcdir)/inssel-sparc.brg
307 arch_built=cpu-sparc.h
308 arch_define=__sparc__
312 arch_sources = $(s390_sources)
313 arch_BURGSRC= $(srcdir)/inssel-long32.brg $(srcdir)/inssel-s390.brg
314 arch_built=cpu-s390.h
319 arch_sources = $(s390x_sources)
320 arch_BURGSRC= $(srcdir)/inssel-long.brg $(srcdir)/inssel-s390x.brg
321 arch_built=cpu-s390x.h
326 arch_sources = $(ia64_sources)
327 arch_BURGSRC = $(srcdir)/inssel-long.brg $(srcdir)/inssel-ia64.brg
328 arch_built = cpu-ia64.h
333 arch_sources = $(alpha_sources) $(mono_debugger_sources)
334 arch_BURGSRC = $(srcdir)/inssel-long.brg $(srcdir)/inssel-alpha.brg
335 arch_built = cpu-alpha.h
336 arch_define=__alpha__
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-$(API_VER)/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=$@ $<
366 iltests.il: iltests.il.in Makefile.am
367 echo '// DO NOT EDIT: This file has been generated from iltests.il.in' > iltests.il
368 cpp -Darch=$(arch_define) < $(srcdir)/iltests.il.in | sed 's/^#.*//' >> iltests.il
371 $(ILASM) -output=$@ $<
373 TestDriver.dll: $(srcdir)/TestDriver.cs
374 $(MCS) -out:$@ -target:library $<
376 # we don't always use the perl impl because it's an additional
377 # build dependency for the poor windows users
378 # $(arch_define) is the preprocessor symbol that enables all the opcodes
379 # for the specific platform in mini-ops.h
381 GENMDESC_PRG=perl genmdesc.pl $(arch_define) $(srcdir)
382 else !CROSS_COMPILING
383 GENMDESC_PRG=./genmdesc
384 endif !CROSS_COMPILING
386 cpu-x86.h: cpu-x86.md genmdesc$(EXEEXT)
387 $(GENMDESC_PRG) $(srcdir)/cpu-x86.md cpu-x86.h x86_desc
389 cpu-amd64.h: cpu-amd64.md genmdesc$(EXEEXT)
390 $(GENMDESC_PRG) $(srcdir)/cpu-amd64.md cpu-amd64.h amd64_desc
392 cpu-g4.h: cpu-g4.md genmdesc$(EXEEXT)
393 $(GENMDESC_PRG) $(srcdir)/cpu-g4.md cpu-g4.h ppcg4
395 cpu-arm.h: cpu-arm.md genmdesc$(EXEEXT)
396 $(GENMDESC_PRG) $(srcdir)/cpu-arm.md cpu-arm.h arm_cpu_desc
398 cpu-sparc.h: cpu-sparc.md genmdesc$(EXEEXT)
399 $(GENMDESC_PRG) $(srcdir)/cpu-sparc.md cpu-sparc.h sparc_desc
401 cpu-s390.h: cpu-s390.md genmdesc$(EXEEXT)
402 $(GENMDESC_PRG) $(srcdir)/cpu-s390.md cpu-s390.h s390_cpu_desc
404 cpu-s390x.h: cpu-s390x.md genmdesc$(EXEEXT)
405 $(GENMDESC_PRG) $(srcdir)/cpu-s390x.md cpu-s390x.h s390x_cpu_desc
407 cpu-ia64.h: cpu-ia64.md genmdesc$(EXEEXT)
408 $(GENMDESC_PRG) $(srcdir)/cpu-ia64.md cpu-ia64.h ia64_desc
410 cpu-alpha.h: cpu-alpha.md genmdesc$(EXEEXT)
411 $(GENMDESC_PRG) $(srcdir)/cpu-alpha.md cpu-alpha.h alpha_desc
413 cpu-mips.h: cpu-mips.md genmdesc$(EXEEXT)
414 $(GENMDESC_PRG) $(srcdir)/cpu-mips.md cpu-mips.h mips_desc
416 inssel.c inssel.h: $(BURGSRC)
417 $(monodir)/mono/monoburg/monoburg -c 1 -p -e $(BURGSRC) -d inssel.h -s inssel.c
420 $(RUNTIME) -v -v --ncompile 1 --compile Test:$(mtest) test.exe
422 # ensure the tests are actually correct
423 checktests: $(regtests)
424 for i in $(regtests); do $(RUNTIME) $$i; done
426 checktests2: $(regtests2)
427 for i in $(regtests); do $(RUNTIME2) $$i; done
429 rcheck: mono $(regtests) $(regtests2)
430 $(RUNTIME) --regression $(regtests)
431 $(RUNTIME2) --regression $(regtests2)
433 aotcheck: mono $(regtests)
434 for i in $(regtests); do $(RUNTIME) --aot $$i; done
435 # for i in $(regtests2); do $(RUNTIME2) --aot $$i; done
436 $(RUNTIME) --regression $(regtests)
437 # $(RUNTIME2) --verbose --regression $(regtests2)
441 time env $(RUNTIME) --ncompile $(count) --compile Test:$(mtest) test.exe
444 time $(monodir)/mono/jit/mono --ncompile $(count) --compile Test:$(mtest) test.exe
446 stat1: mono bench.exe
447 $(RUNTIME) --verbose --statfile stats.pl --regression bench.exe
448 perl viewstat.pl stats.pl
450 stat2: mono basic.exe
451 $(RUNTIME) --verbose --statfile stats.pl --regression basic.exe
452 perl viewstat.pl -e stats.pl
454 stat3: mono bench.exe
455 $(RUNTIME) --statfile stats.pl --ncompile 1000 --compile Tests:test_0_many_nested_loops bench.exe
456 perl viewstat.pl stats.pl
464 rm -f mono a.out gmon.out *.o test.exe
466 pkgconfigdir = $(libdir)/pkgconfig
468 BUILT_SOURCES = version.h
471 BUILT_SOURCES += inssel.c inssel.h $(arch_built)
474 CLEANFILES= $(BUILT_SOURCES) *.exe *.dll
475 EXTRA_DIST = $(common_BURGSRC) cprop.c TestDriver.cs ldscript ldscript.mono \
477 $(test_sources) $(test_sources2) \
478 inssel-long.brg inssel-long32.brg \
479 inssel-softfloat.brg \
480 $(x86_sources) inssel-x86.brg cpu-x86.md \
481 $(amd64_sources) inssel-amd64.brg cpu-amd64.md \
482 $(ppc_sources) inssel-ppc.brg cpu-g4.md \
483 $(arm_sources) inssel-arm.brg cpu-arm.md \
484 $(mips_sources) inssel-mips.brg inssel-long32-mips.brg cpu-mips.md \
485 $(sparc_sources) inssel-sparc.brg cpu-sparc.md \
486 $(s390_sources) inssel-s390.brg cpu-s390.md \
487 $(s390x_sources) inssel-s390x.brg cpu-s390x.md \
488 $(ia64_sources) inssel-ia64.brg cpu-ia64.md \
489 $(alpha_sources) inssel-alpha.brg cpu-alpha.md
492 if test -d $(srcdir)/.svn; then \
494 branch=`svn info | grep URL | sed -e 's/.*source//' -e 's,mono/mono/mini,,'`; \
495 version=`svn info | grep Revision | sed 's/.*: //'`; \
496 echo "#define FULL_VERSION \"$$branch r$$version\""; \
499 echo "#define FULL_VERSION \"tarball\""; \