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 noinst_PROGRAMS = genmdesc
77 lib_LTLIBRARIES = libmono.la
78 noinst_LTLIBRARIES = libmono-static.la
85 # Link libmono into mono statically
86 # This leads to higher performance, especially with TLS
87 MONO_LIB=libmono-static.la
98 $(static_flags) -export-dynamic $(monobinldflags)
105 # Don't link this against libmonoruntime to speed up rebuilds
107 $(monodir)/mono/utils/libmonoutils.la $(monodir)/mono/metadata/opcodes.lo -lm \
193 local-propagation.c \
222 test_sources2 = generics.2.cs il2tests.2.il
224 if MONO_DEBUGGER_SUPPORTED
225 mono_debugger_sources = debug-debugger.c debug-debugger.h
227 mono_debugger_sources =
230 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
231 regtests2=generics.exe il2tests.exe
233 common_BURGSRC= $(srcdir)/inssel.brg $(srcdir)/inssel-float.brg
237 $(x86_sources) $(mono_debugger_sources)
238 arch_BURGSRC= $(srcdir)/inssel-long32.brg $(srcdir)/inssel-x86.brg
244 $(amd64_sources) $(mono_debugger_sources)
245 arch_BURGSRC= $(srcdir)/inssel-long.brg $(srcdir)/inssel-amd64.brg
246 arch_built=cpu-amd64.h
252 arch_BURGSRC= $(srcdir)/inssel-long32.brg $(srcdir)/inssel-ppc.brg
258 # pick up arm_dpimacros.h and arm_fpamacros.h
259 ARCH_CFLAGS = -I../arch/arm
261 arch_sources = $(arm_sources)
263 arch_BURGSRC= $(srcdir)/inssel-long32.brg $(srcdir)/inssel-arm.brg
271 arch_BURGSRC= $(srcdir)/inssel-long32.brg $(srcdir)/inssel-sparc.brg
272 arch_built=cpu-sparc.h
279 arch_BURGSRC= $(srcdir)/inssel-long.brg $(srcdir)/inssel-sparc.brg
280 arch_built=cpu-sparc.h
287 arch_BURGSRC= $(srcdir)/inssel-long32.brg $(srcdir)/inssel-s390.brg
288 arch_built=cpu-s390.h
295 arch_BURGSRC= $(srcdir)/inssel-long.brg $(srcdir)/inssel-s390x.brg
296 arch_built=cpu-s390x.h
303 arch_BURGSRC = $(srcdir)/inssel-long.brg $(srcdir)/inssel-ia64.brg
304 arch_built = cpu-ia64.h
311 arch_BURGSRC = $(srcdir)/inssel-long.brg $(srcdir)/inssel-alpha.brg
312 arch_built = cpu-alpha.h
315 libmono_la_SOURCES = $(common_sources) $(arch_sources)
317 nodist_libmono_la_SOURCES = inssel.c inssel.h
319 libmono_static_la_SOURCES = $(libmono_la_SOURCES)
320 nodist_libmono_static_la_SOURCES = $(nodist_libmono_la_SOURCES)
321 libmono_static_la_LDFLAGS = -static
322 libmono_static_la_LIBADD = $(static_libs)
324 BURGSRC= $(common_BURGSRC) $(arch_BURGSRC)
326 libmonoincludedir = $(includedir)/mono/jit
328 libmonoinclude_HEADERS = jit.h
330 libmono_la_LIBADD = \
333 %.exe: %.2.cs TestDriver.dll
334 $(GMCS) -out:$@ $< -r:TestDriver.dll
336 %.exe: %.cs TestDriver.dll
337 $(MCS) -out:$@ -unsafe $< -r:TestDriver.dll
340 $(ILASM2) -output=$@ $<
343 $(ILASM) -output=$@ $<
345 TestDriver.dll: $(srcdir)/TestDriver.cs
346 $(MCS) -out:$@ -target:library $<
350 cpu-x86.h: cpu-x86.md
351 cpu-amd64.h: cpu-amd64.md
353 cpu-arm.h: cpu-arm.md
354 cpu-sparc.h: cpu-sparc.md
355 cpu-s390.h: cpu-s390.md
356 cpu-s390x.h: cpu-s390x.md
357 cpu-ia64.h: cpu-ia64.md
358 cpu-alpha.h: cpu-alpha.md
360 ## Gross hack. Making 'genmdesc' a host binary takes more effort
362 echo "*** please build $(arch_built) on a native build tree and copy it here"
365 else !CROSS_COMPILING
367 cpu-x86.h: cpu-x86.md genmdesc$(EXEEXT)
368 ./genmdesc $(srcdir)/cpu-x86.md cpu-x86.h x86_desc
370 cpu-amd64.h: cpu-amd64.md genmdesc$(EXEEXT)
371 ./genmdesc $(srcdir)/cpu-amd64.md cpu-amd64.h amd64_desc
373 cpu-g4.h: cpu-g4.md genmdesc$(EXEEXT)
374 ./genmdesc $(srcdir)/cpu-g4.md cpu-g4.h ppcg4
376 cpu-arm.h: cpu-arm.md genmdesc$(EXEEXT)
377 ./genmdesc $(srcdir)/cpu-arm.md cpu-arm.h arm_cpu_desc
379 cpu-sparc.h: cpu-sparc.md genmdesc$(EXEEXT)
380 ./genmdesc $(srcdir)/cpu-sparc.md cpu-sparc.h sparc_desc
382 cpu-s390.h: cpu-s390.md genmdesc$(EXEEXT)
383 ./genmdesc $(srcdir)/cpu-s390.md cpu-s390.h s390_cpu_desc
385 cpu-s390x.h: cpu-s390x.md genmdesc$(EXEEXT)
386 ./genmdesc $(srcdir)/cpu-s390x.md cpu-s390x.h s390x_cpu_desc
388 cpu-ia64.h: cpu-ia64.md genmdesc$(EXEEXT)
389 ./genmdesc $(srcdir)/cpu-ia64.md cpu-ia64.h ia64_desc
391 cpu-alpha.h: cpu-alpha.md genmdesc$(EXEEXT)
392 ./genmdesc $(srcdir)/cpu-alpha.md cpu-alpha.h alpha_desc
394 endif !CROSS_COMPILING
396 inssel.c inssel.h: $(BURGSRC)
397 $(monodir)/mono/monoburg/monoburg -c 1 -p -e $(BURGSRC) -d inssel.h -s inssel.c
400 $(RUNTIME) -v -v --ncompile 1 --compile Test:$(mtest) test.exe
402 # ensure the tests are actually correct
403 checktests: $(regtests)
404 for i in $(regtests); do $(RUNTIME) $$i; done
406 checktests2: $(regtests2)
407 for i in $(regtests); do $(RUNTIME2) $$i; done
409 rcheck: mono $(regtests) $(regtests2)
410 $(RUNTIME) --regression $(regtests)
411 $(RUNTIME2) --regression $(regtests2)
413 aotcheck: mono $(regtests)
414 for i in $(regtests); do $(RUNTIME) --aot $$i; done
415 # for i in $(regtests2); do $(RUNTIME2) --aot $$i; done
416 $(RUNTIME) --regression $(regtests)
417 # $(RUNTIME2) --verbose --regression $(regtests2)
421 time env $(RUNTIME) --ncompile $(count) --compile Test:$(mtest) test.exe
424 time $(monodir)/mono/jit/mono --ncompile $(count) --compile Test:$(mtest) test.exe
426 stat1: mono bench.exe
427 $(RUNTIME) --verbose --statfile stats.pl --regression bench.exe
428 perl viewstat.pl stats.pl
430 stat2: mono basic.exe
431 $(RUNTIME) --verbose --statfile stats.pl --regression basic.exe
432 perl viewstat.pl -e stats.pl
434 stat3: mono bench.exe
435 $(RUNTIME) --statfile stats.pl --ncompile 1000 --compile Tests:test_0_many_nested_loops bench.exe
436 perl viewstat.pl stats.pl
444 rm -f mono a.out gmon.out *.o test.exe
446 pkgconfigdir = $(libdir)/pkgconfig
449 BUILT_SOURCES= inssel.c inssel.h $(arch_built)
452 CLEANFILES= $(BUILT_SOURCES) *.exe *.dll
453 EXTRA_DIST = $(common_BURGSRC) cprop.c TestDriver.cs ldscript ldscript.mono \
454 $(test_sources) $(test_sources2) \
455 inssel-long.brg inssel-long32.brg \
456 $(x86_sources) inssel-x86.brg cpu-x86.md \
457 $(amd64_sources) inssel-amd64.brg cpu-amd64.md \
458 $(ppc_sources) inssel-ppc.brg cpu-g4.md \
459 $(arm_sources) inssel-arm.brg cpu-arm.md \
460 $(sparc_sources) inssel-sparc.brg cpu-sparc.md \
461 $(s390_sources) inssel-s390.brg cpu-s390.md \
462 $(s390x_sources) inssel-s390x.brg cpu-s390x.md \
463 $(ia64_sources) inssel-ia64.brg cpu-ia64.md \
464 $(alpha_sources) inssel-alpha.brg cpu-alpha.md