1 include $(top_srcdir)/mk/common.mk
3 ## Set the C++ linker based on configure settings, see comment in configure.ac
4 ## about why we need to do this.
10 monodir=$(top_builddir)
11 mono=$(if $(MONO_EXECUTABLE),$(MONO_EXECUTABLE),mono)
14 PLATFORM_PATH_SEPARATOR=;
16 PLATFORM_PATH_SEPARATOR=:
19 # This is needed for automake dependency generation
24 libgc_libs=$(monodir)/libgc/libmonogc.la
25 libgc_static_libs=$(monodir)/libgc/libmonogc-static.la
28 glib_libs = $(monodir)/mono/eglib/libeglib.la
31 $(monodir)/mono/metadata/libmonoruntime.la \
32 $(monodir)/mono/utils/libmonoutils.la \
37 $(monodir)/mono/metadata/libmonoruntimesgen.la \
38 $(monodir)/mono/sgen/libmonosgen.la \
39 $(monodir)/mono/utils/libmonoutils.la \
44 include $(mono_build_root)/llvm/llvm_config.mk
45 LLVM_CFLAGS=$(LLVM_CFLAGS_INTERNAL) $(LLVM_CFLAGS_EXTERNAL)
46 LLVM_CXXFLAGS=$(LLVM_CXXFLAGS_INTERNAL) $(LLVM_CXXFLAGS_EXTERNAL)
47 LLVM_LDFLAGS=$(LLVM_LDFLAGS_INTERNAL) $(LLVM_LDFLAGS_EXTERNAL)
48 LLVM_LIBS=$(LLVM_LIBS_INTERNAL) $(LLVM_LIBS_EXTERNAL)
50 $(mono_build_root)/llvm/llvm_config.mk:
51 $(MAKE) -C $(top_builddir)/llvm $(mono_build_root)/llvm/llvm_config.mk
57 # if the tests are going to run with framework assemblies compiled with
58 # -d:MOBILE, tell the runtime to remap framework assemblies using the mobile
60 MOBILE_RUNTIME_ARG=--runtime=mobile
65 CLASS=$(mcs_topdir)/class/lib/$(DEFAULT_PROFILE)
67 RUNTIME_EXECUTABLE = $(if $(BOEHM),$(top_builddir)/mono/mini/mono-boehm,$(top_builddir)/runtime/mono-wrapper)
69 MINI_RUNTIME = MONO_PATH=$(CLASS) $(RUNTIME_EXECUTABLE) $(MOBILE_RUNTIME_ARG)
70 TOOLS_RUNTIME = MONO_PATH=$(mcs_topdir)/class/lib/build $(top_builddir)/runtime/mono-wrapper
71 INTERP_RUNTIME = $(MINI_RUNTIME) --interpreter
72 RUNTIME_AOTCHECK = MONO_PATH="$(CLASS)$(PLATFORM_PATH_SEPARATOR)." $(RUNTIME_EXECUTABLE)
74 MCS = CSC_SDK_PATH_DISABLED= $(TOOLS_RUNTIME) --clr-memory-model $(CSC) -langversion:7.2 -nostdlib -unsafe -nowarn:0162 -nologo -noconfig -r:$(CLASS)/mscorlib.dll -r:$(CLASS)/System.dll -r:$(CLASS)/System.Core.dll
75 ILASM = $(TOOLS_RUNTIME) $(mcs_topdir)/class/lib/build/ilasm.exe
82 $(PLATFORM_CFLAGS) $(ARCH_CFLAGS) $(SHARED_CFLAGS)
84 AM_CXXFLAGS = $(LLVM_CXXFLAGS) $(GLIB_CFLAGS)
88 # The mingw math.h has "extern inline" functions that dont appear in libs, so
89 # optimisation is required to actually inline them
93 monoldflags=$(export_ldflags)
94 monobinldflags=$(export_ldflags) $(extra_runtime_ldflags)
97 libmonoldflags=-no-undefined -avoid-version -Wl,--kill-at $(monoldflags)
100 libmonoldflags= -avoid-version $(monoldflags)
102 libmonoldflags=$(monoldflags) -version-info 1:0:0
107 sgen_binaries = mono-sgen
108 sgen_libraries = libmonosgen-2.0.la
109 sgen_static_libraries = libmini.la $(interp_libs_with_mini) $(dbg_libs_with_mini) $(sgen_libs)
113 boehm_libraries = libmonoboehm-2.0.la
114 boehm_static_libraries = libmini.la $(interp_libs_with_mini) $(dbg_libs_with_mini) $(boehm_libs)
115 boehm_binaries = mono-boehm
119 mono_bin_suffix = sgen
120 libmono_suffix = sgen
122 mono_bin_suffix = boehm
123 libmono_suffix = boehm
126 if DISABLE_EXECUTABLES
128 mono: mono-$(mono_bin_suffix)
131 mono.exe: mono-$(mono_bin_suffix).exe
135 (cd $(DESTDIR)$(bindir) && ln -sf mono-$(mono_bin_suffix)$(EXEEXT) mono$(EXEEXT))
136 (cd $(DESTDIR)$(libdir); shopt -s nullglob 2>/dev/null; for i in libmono$(libmono_suffix)*; do ln -sf $$i `echo $$i | sed s/$(libmono_suffix)//` ; done)
139 if DISABLE_EXECUTABLES
142 bin_PROGRAMS = $(boehm_binaries) $(sgen_binaries) monow
144 bin_PROGRAMS = $(boehm_binaries) $(sgen_binaries)
148 if DISABLE_EXECUTABLES
151 noinst_PROGRAMS = mono
154 if DISABLE_EXECUTABLES
155 shared_libraries = $(boehm_libraries) $(sgen_libraries)
158 shared_libraries = $(boehm_libraries) $(sgen_libraries)
162 lib_LTLIBRARIES = $(shared_libraries)
164 if DISABLE_INTERPRETER
165 lib_LTLIBRARIES += $(interp_libs)
169 mini_common_lib = libmini.la
174 noinst_LTLIBRARIES = $(mini_common_lib)
176 noinst_LIBRARIES = libmain.a
178 libmain_a_SOURCES = main-sgen.c
180 libmain_a_SOURCES += main.c
182 libmain_a_CFLAGS = $(AM_CFLAGS) @CXX_ADD_CFLAGS@
185 lib_LTLIBRARIES += libmono-llvm.la
186 libmono_llvm_la_SOURCES = mini-llvm.c mini-llvm-cpp.cpp llvm-jit.cpp
187 libmono_llvm_la_LIBADD = $(glib_libs) $(LLVM_LIBS) $(LLVM_LDFLAGS)
190 libmono_llvm_la_LDFLAGS=-Wl,-undefined -Wl,suppress -Wl,-flat_namespace
194 # we need this to prevent automake from generating a default mono_SOURCES = mono.c
198 mono_boehm_CFLAGS = $(AM_CFLAGS) @CXX_REMOVE_CFLAGS@
200 AM_CPPFLAGS = $(LIBGC_CPPFLAGS)
203 mono_sgen_CFLAGS = $(AM_CFLAGS) @CXX_REMOVE_CFLAGS@
205 # We build this after libmono was built so it contains the date when the final
208 buildver-boehm.h: libmini.la $(monodir)/mono/metadata/libmonoruntime.la
209 @echo "const char *build_date = \"`date`\";" > buildver-boehm.h
210 libmain_a-main.$(OBJEXT): buildver-boehm.h
213 buildver-sgen.h: libmini.la $(monodir)/mono/metadata/libmonoruntimesgen.la $(monodir)/mono/sgen/libmonosgen.la
214 @echo "const char *build_date = \"`date`\";" > buildver-sgen.h
216 libmain_a-main-sgen.$(OBJEXT): buildver-sgen.h
219 LIBMONO_DTRACE_OBJECT = .libs/mono-dtrace.$(OBJEXT)
221 MONO_DTRACE_OBJECT = mono-dtrace.$(OBJEXT)
227 LIBMONO_DTRACE_OBJECT =
231 # Link libmono into mono statically
232 # This leads to higher performance, especially with TLS
233 MONO_LIB=$(boehm_static_libraries)
234 MONO_SGEN_LIB=$(sgen_static_libraries)
236 MONO_LIB=libmonoboehm-2.0.la
237 MONO_SGEN_LIB=libmonosgen-2.0.la
243 LLVMMONOF=$(LLVM_LIBS) $(LLVM_LDFLAGS)
257 libmain_a-main.$(OBJEXT) \
264 $(MONO_DTRACE_OBJECT)
266 mono_boehm_LDFLAGS = \
267 $(static_flags) $(monobinldflags) $(monobin_platform_ldflags)
270 libmain_a-main-sgen.$(OBJEXT) \
277 $(MONO_DTRACE_OBJECT)
280 mono_sgen_LDFLAGS = $(static_flags) $(monobinldflags) $(monobin_platform_ldflags)
282 if ENABLE_STATIC_GCC_LIBS
283 mono_sgen_LDFLAGS += -all-static
287 libmonoldflags += -no-undefined
292 # mono_LDADD = $(mono_sgen_LDADD)
293 # mono_LDFLAGS = $(mono_sgen_LDFLAGS)
300 mono-dtrace.$(OBJEXT): $(top_srcdir)/data/mono.d mini.lo $(monodir)/mono/metadata/libmonoruntime-static.la
301 DTRACE="$(DTRACE)" DTRACEFLAGS="$(DTRACEFLAGS)" AR="$(AR)" $(SHELL) $(top_srcdir)/data/dtrace-prelink.sh \
302 $@ $(top_srcdir)/data/mono.d $(monodir)/mono/metadata/libmonoruntime-static.la mini.lo
304 .libs/mono-dtrace.$(OBJEXT): $(top_srcdir)/data/mono.d mini.lo $(monodir)/mono/metadata/libmonoruntime.la
305 DTRACE="$(DTRACE)" DTRACEFLAGS="$(DTRACEFLAGS)" AR="$(AR)" $(SHELL) $(top_srcdir)/data/dtrace-prelink.sh \
306 --pic $@ $(top_srcdir)/data/mono.d $(monodir)/mono/metadata/libmonoruntime.la mini.lo
310 # Create monow.exe, linked for the 'windows' subsystem
313 monow_LDADD = $(mono_boehm_LDADD)
314 monow_LDFLAGS = $(mono_boehm_LDFLAGS) -mwindows
315 monow_SOURCES = $(mono_boehm_SOURCES)
317 monow_LDADD = $(mono_sgen_LDADD)
318 monow_LDFLAGS = $(mono_sgen_LDFLAGS) -mwindows
319 monow_SOURCES = $(mono_sgen_SOURCES)
326 mini-wasm-debugger.c \
336 mini-x86-gsharedvt.c \
337 tramp-x86-gsharedvt.c
344 mini-amd64-gsharedvt.c \
345 mini-amd64-gsharedvt.h \
346 tramp-amd64-gsharedvt.c
359 mini-arm-gsharedvt.c \
360 tramp-arm-gsharedvt.c
367 mini-arm64-gsharedvt.c \
368 mini-arm64-gsharedvt.h \
369 tramp-arm64-gsharedvt.c
401 mini-windows-tls-callback.c \
403 mini-windows-dllmain.c \
404 mini-windows-dlldac.c
424 interp/interp-internals.h \
431 interp_libs = libmono-ee-interp.la
433 if !DISABLE_INTERPRETER
434 interp_libs_with_mini = $(interp_libs)
438 llvm_runtime_sources = \
441 if ENABLE_LLVM_RUNTIME
442 llvm_runtime_sources = \
480 local-propagation.c \
488 wasm_m2n_invoke.g.h \
494 mini-generic-sharing.c \
499 mini-native-types.c \
510 debugger-agent-stubs.c \
511 debugger-state-machine.h \
517 mini-cross-helpers.c \
534 # keep in sync with mcs/class/Mono.Runtime.Tests
546 devirtualization.cs \
550 generics-variant-types.il\
557 MemoryIntrinsics.il \
561 regtests_UNIVERSAL = \
574 devirtualization.exe \
584 regtests_DISABLED += builtin-types.exe
587 regtests = $(filter-out $(regtests_DISABLED),$(regtests_UNIVERSAL))
590 arch_sources = $(wasm_sources)
591 arch_built=cpu-wasm.h
593 target_define=TARGET_WASM
597 arch_sources = $(x86_sources)
600 target_define=TARGET_X86
604 arch_sources = $(amd64_sources)
605 arch_built=cpu-amd64.h
606 arch_define=__x86_64__
607 target_define=TARGET_AMD64
608 ARCH_FULLAOT_EXCLUDE=
612 arch_sources = $(ppc_sources)
615 target_define=TARGET_POWERPC
619 arch_sources = $(ppc_sources)
620 arch_built=cpu-ppc64.h
621 arch_define=__ppc64__
622 target_define=TARGET_POWERPC
626 arch_sources = $(mips_sources)
627 arch_built=cpu-mips.h
629 target_define=TARGET_MIPS
633 # pick up arm_dpimacros.h
634 ARCH_CFLAGS = -I../arch/arm
635 arch_sources = $(arm_sources)
638 target_define=TARGET_ARM
642 arch_sources = $(arm64_sources)
643 arch_built=cpu-arm64.h
644 arch_define=__aarch64__
645 target_define=TARGET_ARM64
649 arch_sources = $(sparc_sources)
650 arch_built=cpu-sparc.h
651 arch_define=__sparc__
652 target_define=TARGET_SPARC
656 arch_sources = $(sparc_sources)
657 arch_built=cpu-sparc.h
658 arch_define=__sparc__
659 target_define=TARGET_SPARC
663 arch_sources = $(s390x_sources)
664 arch_built=cpu-s390x.h
666 target_define=TARGET_S390X
670 arch_sources = $(riscv_sources)
671 arch_built = cpu-riscv32.h
672 arch_define = __riscv
673 target_define = TARGET_RISCV32
677 arch_sources = $(riscv_sources)
678 arch_built = cpu-riscv64.h
679 arch_define = __riscv
680 target_define = TARGET_RISCV64
684 os_sources = $(windows_sources)
685 monobin_platform_ldflags=
689 os_sources = $(posix_sources)
690 monobin_platform_ldflags=
694 os_sources = $(darwin_sources) $(posix_sources)
695 #monobin_platform_ldflags=-sectcreate __TEXT __info_plist $(top_srcdir)/mono/mini/Info.plist -framework CoreFoundation -framework Foundation
696 monobin_platform_ldflags=-framework CoreFoundation -framework Foundation
699 if MONO_JEMALLOC_ENABLED
700 libmonoldflags += $(JEMALLOC_LDFLAGS)
703 libmono_ee_interp_la_SOURCES = $(interp_sources)
704 libmono_ee_interp_la_CFLAGS = $(AM_CFLAGS) @CXX_ADD_CFLAGS@ $(INTERP_CFLAGS)
706 libmono_ee_interp_la_LDFLAGS = $(libmonoldflags)
707 if DISABLE_INTERPRETER
708 libmono_ee_interp_la_LIBADD = libmonosgen-2.0.la
713 extra_libmono_dbg_source = debugger-engine.c
716 libmono_dbg_la_SOURCES = debugger-agent.c debugger-state-machine.c $(extra_libmono_dbg_source)
717 libmono_dbg_la_CFLAGS = $(AM_CFLAGS) @CXX_ADD_CFLAGS@
719 if DISABLE_DEBUGGER_AGENT
720 libmono_dbg_la_LIBADD = libmonosgen-2.0.la
724 dbg_libs = libmono-dbg.la
726 if DISABLE_DEBUGGER_AGENT
727 lib_LTLIBRARIES += $(dbg_libs)
730 if !DISABLE_DEBUGGER_AGENT
731 dbg_libs_with_mini = $(dbg_libs)
732 noinst_LTLIBRARIES += $(dbg_libs)
736 # This library is shared between mono and mono-sgen, since the code in mini/ doesn't contain
737 # compile time dependencies on boehm/sgen.
739 libmini_la_SOURCES = $(common_sources) $(llvm_sources) $(llvm_runtime_sources) $(arch_sources) $(os_sources) $(netcore_sources)
740 libmini_la_CFLAGS = $(AM_CFLAGS) @CXX_ADD_CFLAGS@
742 libmonoboehm_2_0_la_SOURCES =
743 libmonoboehm_2_0_la_CFLAGS = $(mono_boehm_CFLAGS) @CXX_ADD_CFLAGS@
745 libmonoboehm_2_0_la_LIBADD = libmini.la $(interp_libs_with_mini) $(dbg_libs_with_mini) $(boehm_libs) $(LIBMONO_DTRACE_OBJECT) $(LLVMMONOF)
746 libmonoboehm_2_0_la_LDFLAGS = $(libmonoldflags) $(monobin_platform_ldflags)
748 libmonosgen_2_0_la_SOURCES =
749 libmonosgen_2_0_la_CFLAGS = $(mono_sgen_CFLAGS) @CXX_ADD_CFLAGS@
751 libmonosgen_2_0_la_LIBADD = libmini.la $(interp_libs_with_mini) $(dbg_libs_with_mini) $(sgen_libs) $(LIBMONO_DTRACE_OBJECT) $(LLVMMONOF)
752 libmonosgen_2_0_la_LDFLAGS = $(libmonoldflags) $(monobin_platform_ldflags)
754 libmonoincludedir = $(includedir)/mono-$(API_VER)/mono/jit
756 # These are public headers.
757 # They should not use glib.h, G_BEGIN_DECLS, guint, etc.
758 # They should be wrapped in MONO_BEGIN_DECLS / MONO_END_DECLS.
759 libmonoinclude_HEADERS = jit.h
761 CSFLAGS = -unsafe -nowarn:0219,0169,0414,0649,0618
763 basic-simd.exe: basic-simd.cs TestDriver.dll
764 $(MCS) -out:$@ $(CSFLAGS) $< -r:TestDriver.dll -r:$(CLASS)/Mono.Simd.dll
766 basic-vectors.exe: basic-vectors.cs TestDriver.dll
767 $(MCS) -out:$@ $(CSFLAGS) $< -r:TestDriver.dll -r:$(CLASS)/System.Numerics.dll -r:$(CLASS)/System.Numerics.Vectors.dll
769 builtin-types.exe: builtin-types.cs TestDriver.dll
770 $(MCS) -out:$@ $(CSFLAGS) -define:ARCH_$(shell echo $$((8 * $(SIZEOF_VOID_P)))) $< -r:TestDriver.dll
772 nacl.exe: nacl.cs TestDriver.dll
773 $(MCS) -out:$@ $(CSFLAGS) $< -r:TestDriver.dll -r:$(CLASS)/Mono.Simd.dll
775 generics.exe: generics.cs TestDriver.dll generics-variant-types.dll
776 $(MCS) -out:$@ $(CSFLAGS) $< -r:TestDriver.dll -r:generics-variant-types.dll -r:$(CLASS)/System.Core.dll
778 unaligned.exe: unaligned.cs TestDriver.dll MemoryIntrinsics.dll
779 $(MCS) -out:$@ $(CSFLAGS) $< -r:TestDriver.dll -r:MemoryIntrinsics.dll
781 %.exe: %.cs TestDriver.dll
782 $(MCS) -out:$@ $(CSFLAGS) $< -r:TestDriver.dll
785 $(ILASM) -output=$@ $<
787 TestDriver.dll: $(srcdir)/TestDriver.cs $(srcdir)/TestHelpers.cs
788 $(MCS) -out:$@ -target:library $^
790 generics-variant-types.dll: generics-variant-types.il
791 $(ILASM) -dll -output=$@ $<
793 MemoryIntrinsics.dll: MemoryIntrinsics.il
794 $(ILASM) -dll -output=$@ $<
798 GENMDESC_PRG=python $(srcdir)/genmdesc.py $(target_define) $(srcdir)
800 cpu-wasm.h: mini-ops.h cpu-wasm.md $(srcdir)/genmdesc.py
801 $(GENMDESC_PRG) cpu-wasm.h wasm_desc $(srcdir)/cpu-wasm.md
803 cpu-x86.h: mini-ops.h cpu-x86.md $(srcdir)/genmdesc.py
804 $(GENMDESC_PRG) cpu-x86.h x86_desc $(srcdir)/cpu-x86.md
806 cpu-amd64.h: mini-ops.h cpu-amd64.md $(srcdir)/genmdesc.py
807 $(GENMDESC_PRG) cpu-amd64.h amd64_desc $(srcdir)/cpu-amd64.md
809 cpu-ppc.h: mini-ops.h cpu-ppc.md $(srcdir)/genmdesc.py
810 $(GENMDESC_PRG) cpu-ppc.h ppcg4 $(srcdir)/cpu-ppc.md
812 cpu-ppc64.h: mini-ops.h cpu-ppc64.md $(srcdir)/genmdesc.py
813 $(GENMDESC_PRG) cpu-ppc64.h ppc64_cpu_desc $(srcdir)/cpu-ppc64.md
815 cpu-arm.h: mini-ops.h cpu-arm.md $(srcdir)/genmdesc.py
816 $(GENMDESC_PRG) cpu-arm.h arm_cpu_desc $(srcdir)/cpu-arm.md
818 cpu-arm64.h: mini-ops.h cpu-arm64.md $(srcdir)/genmdesc.py
819 $(GENMDESC_PRG) cpu-arm64.h arm64_cpu_desc $(srcdir)/cpu-arm64.md
821 cpu-sparc.h: mini-ops.h cpu-sparc.md $(srcdir)/genmdesc.py
822 $(GENMDESC_PRG) cpu-sparc.h sparc_desc $(srcdir)/cpu-sparc.md
824 cpu-s390x.h: mini-ops.h cpu-s390x.md $(srcdir)/genmdesc.py
825 $(GENMDESC_PRG) cpu-s390x.h s390x_cpu_desc $(srcdir)/cpu-s390x.md
827 cpu-mips.h: mini-ops.h cpu-mips.md $(srcdir)/genmdesc.py
828 $(GENMDESC_PRG) cpu-mips.h mips_desc $(srcdir)/cpu-mips.md
830 cpu-riscv32.h: cpu-riscv32.md $(srcdir)/genmdesc.py
831 $(GENMDESC_PRG) cpu-riscv32.h riscv32_cpu_desc $(srcdir)/cpu-riscv32.md
833 cpu-riscv64.h: cpu-riscv64.md $(srcdir)/genmdesc.py
834 $(GENMDESC_PRG) cpu-riscv64.h riscv64_cpu_desc $(srcdir)/cpu-riscv64.md
837 $(MINI_RUNTIME) -v -v --ncompile 1 --compile Test:$(mtest) test.exe
839 test-local: $(regtests)
842 mkdir -p $(TEST_BUNDLE_PATH)/tests/mini
843 cp -L $(regtests) TestDriver.dll MemoryIntrinsics.dll generics-variant-types.dll $(TEST_BUNDLE_PATH)/tests/mini/
844 cp -L mono-sgen $(TEST_BUNDLE_PATH)/
845 chmod +x $(TEST_BUNDLE_PATH)/mono-sgen
847 cp -L mono-boehm $(TEST_BUNDLE_PATH)/
848 chmod +x $(TEST_BUNDLE_PATH)/mono-boehm
851 # ensure the tests are actually correct
852 checktests: $(regtests)
853 for i in $(regtests); do $(MINI_RUNTIME) $$i; done
855 rcheck-nunit: mono $(regtests)
856 $(MINI_RUNTIME) --regression $(regtests) > regressiontests.out 2>&1; cat regressiontests.out; \
857 if grep -q "100% pass" regressiontests.out; then successbool=True; failurescount=0; else successbool=False; failurescount=1; fi; \
858 echo "<?xml version='1.0' encoding='utf-8'?>\
859 <test-results failures='$$failurescount' total='1' not-run='0' name='regression-tests.dummy' date='$$(date +%F)' time='$$(date +%T)'>\
860 <test-suite name='regression-tests.dummy' success='$$successbool' time='0'>\
861 <results><test-case name='MonoTests.regressions.100percentsuccess' executed='True' success='$$successbool' time='0'>" > TestResult-regression.xml; \
862 if [ "$$successbool" = "False" ]; then echo "<failure><message><![CDATA[$$(cat regressiontests.out)]]></message><stack-trace></stack-trace></failure>" >> TestResult-regression.xml; fi; \
863 echo "</test-case></results>\
865 </test-results>" >> TestResult-regression.xml; exit $$failurescount
867 rcheck: mono $(regtests)
868 $(MINI_RUNTIME) --regression $(regtests)
870 richeck: mono $(regtests)
871 $(INTERP_RUNTIME) --regression $(regtests)
873 mixedcheck: mono mixed.exe
874 $(MINI_RUNTIME) --interp=jit=JitClass mixed.exe
878 # This test is fragile so disabled by default.
879 # single_imm_size support is incomplete.
880 # __declspec (thread) support breaks it.
881 # See https://github.com/mono/mono/pull/15599#issuecomment-509444313.
882 # See https://github.com/mono/mono/pull/15567.
883 # It was already previously disabled for ARM.
884 check-seq-points-force: mono $(regtests)
885 rm -f TestResult-op_il_seq_point.xml
886 for i in $(regtests); do $(srcdir)/test_op_il_seq_point.sh $(DEFAULT_PROFILE) $$i || ($(srcdir)/test_op_il_seq_point_headerfooter.sh; exit 1) || exit 1; done
887 for i in $(regtests); do $(srcdir)/test_op_il_seq_point.sh $(DEFAULT_PROFILE) $$i --aot || ($(srcdir)/test_op_il_seq_point_headerfooter.sh; exit 1) || exit 1; done
888 $(srcdir)/test_op_il_seq_point_headerfooter.sh
890 gctest: mono gc-test.exe
891 MONO_DEBUG_OPTIONS=clear-nursery-at-gc $(MINI_RUNTIME) --regression gc-test.exe
893 LLVM_AOT_RUNTIME_OPTS=$(if $(LLVM),--llvm,)
894 GSHAREDVT_RUNTIME_OPTS=$(if $(GSHAREDVT),-O=gsharedvt,)
896 aotcheck: mono $(regtests)
897 rm -rf *.exe.so *.exe.dylib *.exe.dylib.dSYM
898 $(MINI_RUNTIME) $(LLVM_AOT_RUNTIME_OPTS) --aot $(regtests) || exit 1
899 for i in $(regtests); do $(RUNTIME_AOTCHECK) --regression $$i || exit 1; done
900 rm -rf *.exe.so *.exe.dylib *.exe.dylib.dSYM
903 $(MAKE) aotcheck LLVM=1
906 $(MAKE) fullaotcheck GSHAREDVT=1
909 $(MAKE) fullaotcheck HYBRID=1
911 # FIXME: force preemptive suspend while interpreter doesn't support coop/hybird suspend
913 $(MAKE) fullaotcheck MIXED=1 MONO_THREADS_SUSPEND=preemptive
915 fullaot_regtests = $(regtests)
916 fullaot_testing_deps = generics-variant-types.dll TestDriver.dll MemoryIntrinsics.dll
917 fullaot_testing_deps_commas = generics-variant-types.dll,TestDriver.dll,MemoryIntrinsics.dll
919 FULLAOT_LIBS_UNIVERSAL = \
924 System.Security.dll \
927 System.Numerics.dll \
928 System.Numerics.Vectors.dll \
930 System.Configuration.dll
932 FULLAOT_LIBS_DISABLED =
934 # Skip aoting the tests that aren't compiled
935 # on the full aot profiles because they're skipped
938 FULLAOT_LIBS_DISABLED += \
940 System.Configuration.dll
942 if FULL_AOT_INTERP_TESTS
943 FULLAOT_LIBS_DISABLED += \
945 System.Configuration.dll
949 FULLAOT_LIBS = $(filter-out $(FULLAOT_LIBS_DISABLED),$(FULLAOT_LIBS_UNIVERSAL))
951 FULLAOT_TMP_DIR=$(top_builddir)/mono/mini/fullaot-tmp
953 FULLAOT_AOT_ARGS=$(if $(HYBRID),hybrid,full,interp),$(MONO_FULLAOT_ADDITIONAL_ARGS)$(INVARIANT_AOT_OPTIONS)
954 FULLAOT_ARGS=$(if $(HYBRID),--hybrid-aot,--full-aot)
956 # This currently only works on amd64/arm
957 fullaotcheck: $(mono) $(fullaot_regtests) $(fullaot_testing_deps)
958 rm -rf $(FULLAOT_TMP_DIR)
959 mkdir $(FULLAOT_TMP_DIR)
960 $(MAKE) fullaot-libs AOT_FLAGS="$(FULLAOT_AOT_ARGS)"
961 cp $(fullaot_regtests) $(fullaot_testing_deps) $(FULLAOT_TMP_DIR)/
962 MONO_PATH=$(FULLAOT_TMP_DIR) $(top_builddir)/runtime/mono-wrapper $(MOBILE_RUNTIME_ARG) $(LLVM_AOT_RUNTIME_OPTS) $(GSHAREDVT_RUNTIME_OPTS) --aot="$(FULLAOT_AOT_ARGS)" $(FULLAOT_TMP_DIR)/{$(fullaot_testing_deps_commas),*.exe} || exit 1
963 ln -s $(if $(MONO_EXECUTABLE),$(MONO_EXECUTABLE),$$PWD/mono) $(FULLAOT_TMP_DIR)/
964 for i in $(fullaot_regtests); do echo $$i; MONO_PATH=$(FULLAOT_TMP_DIR) $(top_builddir)/runtime/mono-wrapper $(MOBILE_RUNTIME_ARG) $(FULLAOT_ARGS) $(FULLAOT_TMP_DIR)/$$i --exclude '!FULLAOT' $(ARCH_FULLAOT_EXCLUDE) || exit 1; done
965 if test x$(MIXED) == x1; then failed=0;i=0; while test $$i -lt 900; do i=`expr $$i + 1`; bash -c "echo -n '.'"; MONO_PATH=$(FULLAOT_TMP_DIR) MONO_DEBUG=aot-skip=$$i $(top_builddir)/runtime/mono-wrapper --full-aot-interp $(FULLAOT_TMP_DIR)/basic.exe > $(FULLAOT_TMP_DIR)/mixed.log || failed=1; if test $$failed -eq 1; then echo "Failed at $$i"; exit $$failed; fi; done; fi
967 # This can run in parallel
968 fullaot-libs: $(patsubst %,fullaot-tmp/%.dylib,$(FULLAOT_LIBS))
970 fullaot-tmp/%.dylib: $(CLASS)/%
971 cp $(CLASS)/$* fullaot-tmp/
972 mkdir fullaot-tmp/$*-tmp
973 MONO_PATH="fullaot-tmp/$(PLATFORM_PATH_SEPARATOR)$(CLASS)" $(top_builddir)/runtime/mono-wrapper $(MOBILE_RUNTIME_ARG) $(LLVM_AOT_RUNTIME_OPTS) $(GSHAREDVT_RUNTIME_OPTS) --aot=$(AOT_FLAGS),temp-path=fullaot-tmp/$*-tmp fullaot-tmp/$*
974 rm -rf fullaot-tmp/$*-tmp
977 $(MAKE) fullaotcheck LLVM=1 GSHAREDVT=1
979 llvmonly_regtests = $(fullaot_regtests) gshared.exe
981 llvmonlycheck: mono $(llvmonly_regtests)
984 $(MAKE) fullaot-libs AOT_FLAGS="llvmonly,clangxx=clang++-6.0,$(MONO_FULLAOT_ADDITIONAL_ARGS)$(INVARIANT_AOT_OPTIONS)"
985 cp $(llvmonly_regtests) $(fullaot_testing_deps) fullaot-tmp/
986 MONO_PATH=fullaot-tmp $(top_builddir)/runtime/mono-wrapper $(MOBILE_RUNTIME_ARG) --aot=llvmonly,clangxx=clang++-6.0 fullaot-tmp/{$(fullaot_testing_deps_commas),*.exe} || exit 1
987 ln -s $$PWD/mono fullaot-tmp/
988 for i in $(llvmonly_regtests); do echo $$i; MONO_PATH=fullaot-tmp $(top_builddir)/runtime/mono-wrapper $(MOBILE_RUNTIME_ARG) --llvmonly fullaot-tmp/$$i --exclude '!BITCODE' || exit 1; done
991 MONO_GC_PARAMS=stack-mark=precise MONO_GC_DEBUG=clear-at-gc ./mono-sgen gc-test.exe
994 time env $(MINI_RUNTIME) --ncompile $(count) --compile Test:$(mtest) test.exe
997 time $(monodir)/mono/jit/mono --ncompile $(count) --compile Test:$(mtest) test.exe
999 stat1: mono bench.exe
1000 $(MINI_RUNTIME) --verbose --statfile stats.pl --regression bench.exe
1001 perl viewstat.pl stats.pl
1003 stat2: mono basic.exe
1004 $(MINI_RUNTIME) --verbose --statfile stats.pl --regression basic.exe
1005 perl viewstat.pl -e stats.pl
1007 stat3: mono bench.exe
1008 $(MINI_RUNTIME) --statfile stats.pl --ncompile 1000 --compile Tests:test_0_many_nested_loops bench.exe
1009 perl viewstat.pl stats.pl
1012 docbook2txt mini.sgm
1014 # We need these because automake can't process normal make conditionals
1015 check_local_targets = $(if $(EMIT_NUNIT), rcheck-nunit, rcheck)
1017 check-local: $(check_local_targets)
1020 rm -f mono a.out gmon.out *.o buildver-boehm.h buildver-sgen.h test.exe regressionexitcode.out TestResult-op_il_seq_point.xml*
1022 pkgconfigdir = $(libdir)/pkgconfig
1024 BUILT_SOURCES = version.h $(arch_built)
1026 CLEANFILES= $(BUILT_SOURCES) *.exe *.dll
1027 EXTRA_DIST = TestDriver.cs \
1031 $(wasm_sources) cpu-wasm.md \
1032 $(x86_sources) cpu-x86.md \
1033 $(amd64_sources) cpu-amd64.md \
1034 $(ppc_sources) cpu-ppc.md cpu-ppc64.md \
1035 $(arm_sources) cpu-arm.md \
1036 $(arm64_sources) cpu-arm64.md \
1037 $(mips_sources) cpu-mips.md \
1038 $(sparc_sources) cpu-sparc.md \
1039 $(s390x_sources) cpu-s390x.md \
1040 $(riscv_sources) cpu-riscv32.md cpu-riscv64.md \
1041 $(windows_sources) \
1042 $(darwin_sources) Info.plist \
1044 test_op_il_seq_point.sh \
1045 test_op_il_seq_point_headerfooter.sh \
1049 if test -e $(top_srcdir)/.git; then \
1050 (cd $(top_srcdir); \
1051 LANG=C; export LANG; \
1052 if test -z "$$ghprbPullId"; then \
1053 branch=`git branch | grep '^\*' | sed 's/.*detached .*/explicit/' | cut -d ' ' -f 2`; \
1055 branch="pull-request-$$ghprbPullId"; \
1057 version=`git log --no-color --first-parent -n1 --pretty=format:%h`; \
1058 echo "#define FULL_VERSION \"$$branch/$$version\""; \
1061 if test -z "$$MONO_BRANCH" -o -z "$$MONO_BUILD_REVISION"; then \
1062 echo "#define FULL_VERSION \"tarball\""; \
1064 echo "#define FULL_VERSION \"$$MONO_BRANCH/$$MONO_BUILD_REVISION\""; \
1068 # Utility target for patching libtool to speed up linking
1070 sed -e 's,if (for obj in $$oldobjs,if (for obj in "",g' < ../../libtool > 2; mv 2 ../../libtool
1071 chmod a+x ../../libtool
1073 # Utility target for patching libtool to get rid of the 'ranlib: file <file> has no symbols" warnings
1075 sed -e 's/old_archive_cmds=.*/old_archive_cmds="libtool -no_warning_for_no_symbols -static -o \\$$oldlib \\$$oldobjs"/g' < ../../libtool > 2; mv 2 ../../libtool
1076 chmod a+x ../../libtool
1078 # Utility target to patch automake to generate the same format silent output as the old mono silent build did
1080 src="@echo \" '. \$$name . ' ' x (8 - length (\$$name)) . '\""; dst="@echo \"'. \$$name . ' ' x (7 - length (\$$name)) .'\""; sed -e "s/$$src/$$dst/g" < $$EXE > 2 && cp 2 $$EXE && rm -f 2
1083 etags -o TAGS `find .. -name "*.h" -o -name "*.c"`
1086 llvm_makefile_dep = $(mono_build_root)/llvm/llvm_config.mk
1089 if HAS_EXTENSION_MODULE
1091 Makefile.am: Makefile.am.in
1092 echo "##################### Generated from Makefile.am.in, do not modify ##########################" > $@
1097 # Per-library because linking doesn't like -xc++, it treats libraries as C++.
1098 CFLAGS := $(filter-out @CXX_REMOVE_CFLAGS@, @CFLAGS@)