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 \
24 $(monodir)/mono/metadata/libmonoruntime-static.la \
25 $(monodir)/mono/io-layer/libwapi.la \
26 $(monodir)/mono/utils/libmonoutils.la \
29 $(libgc_static_libs) \
32 CLASS1=$(mcs_topdir)/class/lib/default
33 CLASS2=$(mcs_topdir)/class/lib/net_2_0
35 RUNTIME = MONO_PATH=$(CLASS1) $(top_builddir)/runtime/mono-wrapper
36 RUNTIME2 = MONO_PATH=$(CLASS2) $(top_builddir)/runtime/mono-wrapper
38 MCS = $(RUNTIME) $(CLASS1)/mcs.exe -unsafe -nowarn:0162
39 GMCS = $(RUNTIME2) $(CLASS2)/gmcs.exe -unsafe -nowarn:0162
40 ILASM = $(RUNTIME) $(CLASS1)/ilasm.exe
48 $(PLATFORM_CFLAGS) $(ARCH_CFLAGS)
52 # The mingw math.h has "extern inline" functions that dont appear in libs, so
53 # optimisation is required to actually inline them
57 PLATFORM_LIB = ../os/libmonoos.la
59 # hack for automake to have the same source file in a library and a bin
60 genmdesc_CFLAGS = $(AM_CFLAGS)
66 monoldflags=-Wl,-version-script=$(srcdir)/ldscript
67 monobinldflags=-Wl,-version-script=$(srcdir)/ldscript.mono
71 libmono_la_LDFLAGS=-no-undefined -version-info 1:0:0 $(monoldflags)
73 libmono_la_LDFLAGS=$(monoldflags)
79 noinst_PROGRAMS = genmdesc
81 lib_LTLIBRARIES = libmono.la
82 noinst_LTLIBRARIES = libmono-static.la
89 # Link libmono into mono statically
90 # This leads to higher performance, especially with TLS
91 MONO_LIB=libmono-static.la
100 $(GMODULE_LIBS) -lm \
104 $(static_flags) -export-dynamic $(monobinldflags)
111 # Don't link this against libmonoruntime to speed up rebuilds
113 $(monodir)/mono/utils/libmonoutils.la $(monodir)/mono/metadata/opcodes.lo -lm \
221 test_sources2 = generics.2.cs
223 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
224 regtests2=generics.exe
225 common_BURGSRC= $(srcdir)/inssel.brg $(srcdir)/inssel-float.brg
228 libmono_la_SOURCES = \
229 $(common_sources) $(x86_sources)
231 arch_BURGSRC= $(srcdir)/inssel-long32.brg $(srcdir)/inssel-x86.brg
232 arch_built=cpu-pentium.h
236 libmono_la_SOURCES = \
237 $(common_sources) $(amd64_sources)
238 arch_BURGSRC= $(srcdir)/inssel-long.brg $(srcdir)/inssel-amd64.brg
239 arch_built=cpu-amd64.h
243 libmono_la_SOURCES = \
244 $(common_sources) $(ppc_sources)
246 arch_BURGSRC= $(srcdir)/inssel-long32.brg $(srcdir)/inssel-ppc.brg
252 # pick up arm_dpimacros.h and arm_fpamacros.h
253 ARCH_CFLAGS = -I../arch/arm
255 libmono_la_SOURCES = \
256 $(common_sources) $(arm_sources)
258 arch_BURGSRC= $(srcdir)/inssel-long32.brg $(srcdir)/inssel-arm.brg
263 libmono_la_SOURCES = \
264 $(common_sources) $(sparc_sources)
266 arch_BURGSRC= $(srcdir)/inssel-long32.brg $(srcdir)/inssel-sparc.brg
267 arch_built=cpu-sparc.h
271 libmono_la_SOURCES = \
272 $(common_sources) $(sparc_sources)
274 arch_BURGSRC= $(srcdir)/inssel-long.brg $(srcdir)/inssel-sparc.brg
275 arch_built=cpu-sparc.h
279 libmono_la_SOURCES = \
280 $(common_sources) $(s390_sources)
282 arch_BURGSRC= $(srcdir)/inssel-long32.brg $(srcdir)/inssel-s390.brg
283 arch_built=cpu-s390.h
287 libmono_la_SOURCES = \
288 $(common_sources) $(s390x_sources)
290 arch_BURGSRC= $(srcdir)/inssel-long.brg $(srcdir)/inssel-s390x.brg
291 arch_built=cpu-s390x.h
295 libmono_la_SOURCES = \
296 $(common_sources) $(ia64_sources)
298 arch_BURGSRC = $(srcdir)/inssel-long.brg $(srcdir)/inssel-ia64.brg
299 arch_built = cpu-ia64.h
302 nodist_libmono_la_SOURCES = inssel.c inssel.h
304 libmono_static_la_SOURCES = $(libmono_la_SOURCES)
305 nodist_libmono_static_la_SOURCES = $(nodist_libmono_la_SOURCES)
306 libmono_static_la_LDFLAGS = -static
307 libmono_static_la_LIBADD = $(static_libs) $(PLATFORM_LIB)
309 BURGSRC= $(common_BURGSRC) $(arch_BURGSRC)
311 libmonoincludedir = $(includedir)/mono/jit
313 libmonoinclude_HEADERS = jit.h
315 libmono_la_LIBADD = \
319 %.exe: %.2.cs TestDriver.dll
320 $(GMCS) -out:$@ $< -r:TestDriver.dll
322 %.exe: %.cs TestDriver.dll
323 $(MCS) -out:$@ -unsafe $< -r:TestDriver.dll
326 $(ILASM) -output=$@ $<
328 TestDriver.dll: $(srcdir)/TestDriver.cs
329 $(MCS) -out:$@ -target:library $<
333 cpu-pentium.h: cpu-pentium.md
334 cpu-amd64.h: cpu-amd64.md
336 cpu-arm.h: cpu-arm.md
337 cpu-sparc.h: cpu-sparc.md
338 cpu-s390.h: cpu-s390.md
339 cpu-s390x.h: cpu-s390x.md
340 cpu-ia64.h: cpu-ia64.md
342 ## Gross hack. Making 'genmdesc' a host binary takes more effort
344 echo "*** please build $(arch_built) on a native build tree and copy it here"
347 else !CROSS_COMPILING
349 cpu-pentium.h: cpu-pentium.md genmdesc$(EXEEXT)
350 ./genmdesc $(srcdir)/cpu-pentium.md cpu-pentium.h pentium_desc
352 cpu-amd64.h: cpu-amd64.md genmdesc$(EXEEXT)
353 ./genmdesc $(srcdir)/cpu-amd64.md cpu-amd64.h amd64_desc
355 cpu-g4.h: cpu-g4.md genmdesc$(EXEEXT)
356 ./genmdesc $(srcdir)/cpu-g4.md cpu-g4.h ppcg4
358 cpu-arm.h: cpu-arm.md genmdesc$(EXEEXT)
359 ./genmdesc $(srcdir)/cpu-arm.md cpu-arm.h arm_cpu_desc
361 cpu-sparc.h: cpu-sparc.md genmdesc$(EXEEXT)
362 ./genmdesc $(srcdir)/cpu-sparc.md cpu-sparc.h sparc_desc
364 cpu-s390.h: cpu-s390.md genmdesc$(EXEEXT)
365 ./genmdesc $(srcdir)/cpu-s390.md cpu-s390.h s390_cpu_desc
367 cpu-s390x.h: cpu-s390x.md genmdesc$(EXEEXT)
368 ./genmdesc $(srcdir)/cpu-s390x.md cpu-s390x.h s390x_cpu_desc
370 cpu-ia64.h: cpu-ia64.md genmdesc$(EXEEXT)
371 ./genmdesc $(srcdir)/cpu-ia64.md cpu-ia64.h ia64_desc
373 endif !CROSS_COMPILING
375 inssel.c inssel.h: $(BURGSRC)
376 $(monodir)/mono/monoburg/monoburg -c 1 -p -e $(BURGSRC) -d inssel.h -s inssel.c
379 $(RUNTIME) -v -v --ncompile 1 --compile Test:$(mtest) test.exe
381 # ensure the tests are actually correct
382 checktests: $(regtests)
383 for i in $(regtests); do $(RUNTIME) $$i; done
385 checktests2: $(regtests2)
386 for i in $(regtests); do $(RUNTIME2) $$i; done
388 rcheck: mono $(regtests) $(regtests2)
389 $(RUNTIME) --regression $(regtests)
390 $(RUNTIME2) --regression $(regtests2)
392 aotcheck: mono $(regtests)
393 for i in $(regtests); do $(RUNTIME) --aot $$i; done
394 for i in $(regtests2); do $(RUNTIME2) --aot $$i; done
395 $(RUNTIME) --verbose --regression $(regtests)
396 $(RUNTIME2) --verbose --regression $(regtests2)
400 time env $(RUNTIME) --ncompile $(count) --compile Test:$(mtest) test.exe
403 time $(monodir)/mono/jit/mono --ncompile $(count) --compile Test:$(mtest) test.exe
405 stat1: mono bench.exe
406 $(RUNTIME) --verbose --statfile stats.pl --regression bench.exe
407 perl viewstat.pl stats.pl
409 stat2: mono basic.exe
410 $(RUNTIME) --verbose --statfile stats.pl --regression basic.exe
411 perl viewstat.pl -e stats.pl
413 stat3: mono bench.exe
414 $(RUNTIME) --statfile stats.pl --ncompile 1000 --compile Tests:test_0_many_nested_loops bench.exe
415 perl viewstat.pl stats.pl
423 rm -f mono a.out gmon.out *.o test.exe
425 pkgconfigdir = $(libdir)/pkgconfig
428 BUILT_SOURCES= inssel.c inssel.h $(arch_built)
431 CLEANFILES= $(BUILT_SOURCES) *.exe *.dll
432 EXTRA_DIST = $(common_BURGSRC) jit-icalls.c cprop.c TestDriver.cs ldscript ldscript.mono \
433 $(test_sources) $(test_sources2) \
434 inssel-long.brg inssel-long32.brg \
435 $(x86_sources) inssel-x86.brg cpu-pentium.md \
436 $(amd64_sources) inssel-amd64.brg cpu-amd64.md \
437 $(ppc_sources) inssel-ppc.brg cpu-g4.md \
438 $(arm_sources) inssel-arm.brg cpu-arm.md \
439 $(sparc_sources) inssel-sparc.brg cpu-sparc.md \
440 $(s390_sources) inssel-s390.brg cpu-s390.md \
441 $(s390x_sources) inssel-s390x.brg cpu-s390x.md \
442 $(ia64_sources) inssel-ia64.brg cpu-ia64.md