1 MAKEFLAGS := $(MAKEFLAGS) --no-builtin-rules
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=:
21 # This is needed for automake dependency generation
26 libgc_libs=$(monodir)/external/bdwgc/libgc.la
27 libgc_static_libs=$(monodir)/external/bdwgc/libgc-static.la
30 glib_libs = $(monodir)/mono/eglib/libeglib.la
33 $(monodir)/mono/metadata/libmonoruntime.la \
34 $(monodir)/mono/utils/libmonoutils.la \
39 $(monodir)/mono/metadata/libmonoruntimesgen.la \
40 $(monodir)/mono/sgen/libmonosgen.la \
41 $(monodir)/mono/utils/libmonoutils.la \
46 include $(mono_build_root)/llvm/llvm_config.mk
47 LLVM_CFLAGS=$(LLVM_CFLAGS_INTERNAL) $(LLVM_CFLAGS_EXTERNAL)
48 LLVM_CXXFLAGS=$(LLVM_CXXFLAGS_INTERNAL) $(LLVM_CXXFLAGS_EXTERNAL)
49 LLVM_LDFLAGS=$(LLVM_LDFLAGS_INTERNAL) $(LLVM_LDFLAGS_EXTERNAL)
50 LLVM_LIBS=$(LLVM_LIBS_INTERNAL) $(LLVM_LIBS_EXTERNAL)
52 $(mono_build_root)/llvm/llvm_config.mk:
53 $(MAKE) -C $(top_builddir)/llvm $(mono_build_root)/llvm/llvm_config.mk
57 endif # !ENABLE_MSVC_ONLY
60 # if the tests are going to run with framework assemblies compiled with
61 # -d:MOBILE, tell the runtime to remap framework assemblies using the mobile
63 MOBILE_RUNTIME_ARG=--runtime=mobile
68 CLASS=$(mcs_topdir)/class/lib/$(DEFAULT_PROFILE)
70 RUNTIME_EXECUTABLE = $(if $(BOEHM),$(top_builddir)/mono/mini/mono-boehm,$(top_builddir)/runtime/mono-wrapper)
72 MINI_RUNTIME = MONO_PATH=$(CLASS) $(RUNTIME_EXECUTABLE) $(MOBILE_RUNTIME_ARG)
73 TOOLS_RUNTIME = MONO_PATH=$(mcs_topdir)/class/lib/build $(top_builddir)/runtime/mono-wrapper
74 INTERP_RUNTIME = $(MINI_RUNTIME) --interpreter
75 RUNTIME_AOTCHECK = MONO_PATH="$(CLASS)$(PLATFORM_PATH_SEPARATOR)." $(RUNTIME_EXECUTABLE)
77 MCS = CSC_SDK_PATH_DISABLED= $(TOOLS_RUNTIME) $(CSC) -langversion:8.0 -nostdlib -unsafe -nowarn:0162 -nologo -noconfig -r:$(CLASS)/mscorlib.dll -r:$(CLASS)/System.dll -r:$(CLASS)/System.Core.dll
78 ILASM = $(TOOLS_RUNTIME) $(mcs_topdir)/class/lib/build/ilasm.exe
87 $(PLATFORM_CFLAGS) $(ARCH_CFLAGS) $(SHARED_CFLAGS)
89 AM_CXXFLAGS = -I$(top_srcdir) $(LLVM_CXXFLAGS) $(GLIB_CFLAGS)
93 # The mingw math.h has "extern inline" functions that dont appear in libs, so
94 # optimisation is required to actually inline them
98 monoldflags=$(export_ldflags)
99 monobinldflags=$(export_ldflags) $(extra_runtime_ldflags)
102 libmonoldflags=-no-undefined -avoid-version -Wl,--kill-at $(monoldflags)
105 libmonoldflags= -avoid-version $(monoldflags)
107 libmonoldflags=$(monoldflags) -version-info 1:0:0
112 sgen_binaries = mono-sgen
113 sgen_libraries = libmonosgen-2.0.la
114 sgen_static_libraries = libmini.la $(interp_libs_with_mini) $(dbg_libs_with_mini) $(sgen_libs)
118 boehm_libraries = libmonoboehm-2.0.la
119 boehm_static_libraries = libmini.la $(interp_libs_with_mini) $(dbg_libs_with_mini) $(boehm_libs)
120 boehm_binaries = mono-boehm
123 endif # !ENABLE_MSVC_ONLY
126 mono_bin_suffix = sgen
127 libmono_suffix = sgen
129 mono_bin_suffix = boehm
130 libmono_suffix = boehm
133 if DISABLE_EXECUTABLES
136 mono: mono-$(mono_bin_suffix)
139 mono.exe: mono-$(mono_bin_suffix).exe
141 else # !ENABLE_MSVC_ONLY
144 make -C $(top_srcdir)/msvc mono
145 ln -sf $(mono_msvc_build_bin_dir)/mono-$(mono_bin_suffix)$(EXEEXT) ./mono.exe
147 ln -sf $(mono_msvc_build_bin_dir)/mono-$(mono_bin_suffix)$(EXEEXT) ./mono-sgen.exe
157 make -C $(top_srcdir)/msvc clean-mono
159 endif # !ENABLE_MSVC_ONLY
162 (cd $(DESTDIR)$(bindir) && ln -sf mono-$(mono_bin_suffix)$(EXEEXT) mono$(EXEEXT))
163 (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)
168 if DISABLE_EXECUTABLES
171 bin_PROGRAMS = $(boehm_binaries) $(sgen_binaries) monow
173 bin_PROGRAMS = $(boehm_binaries) $(sgen_binaries)
177 if DISABLE_EXECUTABLES
180 noinst_PROGRAMS = mono
183 if DISABLE_EXECUTABLES
184 shared_libraries = $(boehm_libraries) $(sgen_libraries)
187 shared_libraries = $(boehm_libraries) $(sgen_libraries)
191 lib_LTLIBRARIES = $(shared_libraries)
193 if DISABLE_INTERPRETER
194 lib_LTLIBRARIES += $(interp_libs)
198 mini_common_lib = libmini.la
203 noinst_LTLIBRARIES = $(mini_common_lib)
205 noinst_LIBRARIES = libmain.a
207 libmain_a_SOURCES = main-sgen.c
209 libmain_a_SOURCES += main.c
211 libmain_a_CFLAGS = $(AM_CFLAGS) @CXX_ADD_CFLAGS@
213 # we need this to prevent automake from generating a default mono_SOURCES = mono.c
217 mono_boehm_CFLAGS = $(AM_CFLAGS) @CXX_REMOVE_CFLAGS@
219 AM_CPPFLAGS = $(LIBGC_CPPFLAGS)
222 mono_sgen_CFLAGS = $(AM_CFLAGS) @CXX_REMOVE_CFLAGS@
224 BUILD_DATE = $(shell SOURCE_DATE_EPOCH="$${SOURCE_DATE_EPOCH:-$$(date +%s)}" ;date -u -d "@$$SOURCE_DATE_EPOCH" 2>/dev/null || date -u -r "$$SOURCE_DATE_EPOCH" 2>/dev/null || date -u)
226 # We build this after libmono was built so it contains the date when the final
229 buildver-boehm.h: libmini.la $(monodir)/mono/metadata/libmonoruntime.la
230 @echo "const char *build_date = \"$(BUILD_DATE)\";" > buildver-boehm.h
231 libmain_a-main.$(OBJEXT): buildver-boehm.h
234 buildver-sgen.h: libmini.la $(monodir)/mono/metadata/libmonoruntimesgen.la $(monodir)/mono/sgen/libmonosgen.la
235 @echo "const char *build_date = \"$(BUILD_DATE)\";" > buildver-sgen.h
237 libmain_a-main-sgen.$(OBJEXT): buildver-sgen.h
240 LIBMONO_DTRACE_OBJECT = .libs/mono-dtrace.$(OBJEXT)
242 MONO_DTRACE_OBJECT = mono-dtrace.$(OBJEXT)
248 LIBMONO_DTRACE_OBJECT =
252 # Link libmono into mono statically
253 # This leads to higher performance, especially with TLS
254 MONO_LIB=$(boehm_static_libraries)
255 MONO_SGEN_LIB=$(sgen_static_libraries)
257 MONO_LIB=libmonoboehm-2.0.la
258 MONO_SGEN_LIB=libmonosgen-2.0.la
261 LLVMMONOF=$(LLVM_LIBS) $(LLVM_LDFLAGS)
264 libmain_a-main.$(OBJEXT) \
271 $(MONO_DTRACE_OBJECT)
273 mono_boehm_LDFLAGS = \
274 $(static_flags) $(monobinldflags) $(monobin_platform_ldflags)
277 libmain_a-main-sgen.$(OBJEXT) \
284 $(MONO_DTRACE_OBJECT)
287 mono_sgen_LDFLAGS = $(static_flags) $(monobinldflags) $(monobin_platform_ldflags)
289 if ENABLE_STATIC_GCC_LIBS
290 mono_sgen_LDFLAGS += -all-static
294 libmonoldflags += -no-undefined
299 # mono_LDADD = $(mono_sgen_LDADD)
300 # mono_LDFLAGS = $(mono_sgen_LDFLAGS)
307 mono-dtrace.$(OBJEXT): $(top_srcdir)/data/mono.d mini.lo $(monodir)/mono/metadata/libmonoruntime-static.la
308 DTRACE="$(DTRACE)" DTRACEFLAGS="$(DTRACEFLAGS)" AR="$(AR)" $(SHELL) $(top_srcdir)/data/dtrace-prelink.sh \
309 $@ $(top_srcdir)/data/mono.d $(monodir)/mono/metadata/libmonoruntime-static.la mini.lo
311 .libs/mono-dtrace.$(OBJEXT): $(top_srcdir)/data/mono.d mini.lo $(monodir)/mono/metadata/libmonoruntime.la
312 DTRACE="$(DTRACE)" DTRACEFLAGS="$(DTRACEFLAGS)" AR="$(AR)" $(SHELL) $(top_srcdir)/data/dtrace-prelink.sh \
313 --pic $@ $(top_srcdir)/data/mono.d $(monodir)/mono/metadata/libmonoruntime.la mini.lo
317 # Create monow.exe, linked for the 'windows' subsystem
320 monow_LDADD = $(mono_boehm_LDADD)
321 monow_LDFLAGS = $(mono_boehm_LDFLAGS) -mwindows
322 monow_SOURCES = $(mono_boehm_SOURCES)
324 monow_LDADD = $(mono_sgen_LDADD)
325 monow_LDFLAGS = $(mono_sgen_LDFLAGS) -mwindows
326 monow_SOURCES = $(mono_sgen_SOURCES)
333 mini-wasm-debugger.c \
343 mini-x86-gsharedvt.c \
344 tramp-x86-gsharedvt.c
351 mini-amd64-gsharedvt.c \
352 mini-amd64-gsharedvt.h \
353 tramp-amd64-gsharedvt.c
355 loongarch64_sources = \
358 exceptions-loongarch64.c \
359 tramp-loongarch64.c \
360 mini-loongarch64-gsharedvt.c \
361 mini-loongarch64-gsharedvt.h \
362 tramp-loongarch64-gsharedvt.c
375 mini-arm-gsharedvt.c \
376 tramp-arm-gsharedvt.c
383 mini-arm64-gsharedvt.c \
384 mini-arm64-gsharedvt.h \
385 tramp-arm64-gsharedvt.c
416 mini-windows-tls-callback.c \
418 mini-windows-dllmain.c \
419 mini-windows-dlldac.c
433 interp/interp-internals.h \
435 interp/interp-intrins.h \
436 interp/interp-intrins.c \
443 interp_libs = libmono-ee-interp.la
445 if !DISABLE_INTERPRETER
446 interp_libs_with_mini = $(interp_libs)
450 llvm_runtime_sources = \
453 if ENABLE_LLVM_RUNTIME
454 llvm_runtime_sources = \
487 local-propagation.c \
495 wasm_m2n_invoke.g.h \
501 mini-generic-sharing.c \
506 mini-native-types.c \
517 debugger-agent-stubs.c \
518 debugger-state-machine.h \
524 mini-cross-helpers.c \
546 endif # !ENABLE_MSVC_ONLY
548 # keep in sync with mcs/class/Mono.Runtime.Tests
560 devirtualization.cs \
564 generics-variant-types.il\
571 MemoryIntrinsics.il \
575 regtests_UNIVERSAL = \
588 devirtualization.exe \
598 regtests_DISABLED += builtin-types.exe
601 regtests = $(filter-out $(regtests_DISABLED),$(regtests_UNIVERSAL))
606 arch_sources = $(wasm_sources)
607 arch_built=cpu-wasm.h
609 target_define=TARGET_WASM
613 arch_sources = $(x86_sources)
616 target_define=TARGET_X86
620 arch_sources = $(amd64_sources)
621 arch_built=cpu-amd64.h
622 arch_define=__x86_64__
623 target_define=TARGET_AMD64
624 ARCH_FULLAOT_EXCLUDE=
628 arch_sources = $(loongarch64_sources)
629 arch_built=cpu-loongarch64.h
630 arch_define=__loongarch64
631 target_define=TARGET_LOONGARCH64
635 arch_sources = $(ppc_sources)
638 target_define=TARGET_POWERPC
642 arch_sources = $(ppc_sources)
643 arch_built=cpu-ppc64.h
644 arch_define=__ppc64__
645 target_define=TARGET_POWERPC
649 arch_sources = $(mips_sources)
650 arch_built=cpu-mips.h
652 target_define=TARGET_MIPS
656 # pick up arm_dpimacros.h
657 ARCH_CFLAGS = -I../arch/arm
658 arch_sources = $(arm_sources)
661 target_define=TARGET_ARM
665 arch_sources = $(arm64_sources)
666 arch_built=cpu-arm64.h
667 arch_define=__aarch64__
668 target_define=TARGET_ARM64
672 arch_sources = $(sparc_sources)
673 arch_built=cpu-sparc.h
674 arch_define=__sparc__
675 target_define=TARGET_SPARC
679 arch_sources = $(sparc_sources)
680 arch_built=cpu-sparc.h
681 arch_define=__sparc__
682 target_define=TARGET_SPARC
686 arch_sources = $(s390x_sources)
687 arch_built=cpu-s390x.h
689 target_define=TARGET_S390X
693 arch_sources = $(riscv_sources)
694 arch_built = cpu-riscv32.h
695 arch_define = __riscv
696 target_define = TARGET_RISCV32
700 arch_sources = $(riscv_sources)
701 arch_built = cpu-riscv64.h
702 arch_define = __riscv
703 target_define = TARGET_RISCV64
707 os_sources = $(windows_sources)
708 monobin_platform_ldflags=
712 os_sources = $(posix_sources)
713 monobin_platform_ldflags=
717 os_sources = $(darwin_sources) $(posix_sources)
718 #monobin_platform_ldflags=-sectcreate __TEXT __info_plist $(top_srcdir)/mono/mini/Info.plist -framework CoreFoundation -framework Foundation
719 monobin_platform_ldflags=-framework CoreFoundation -framework Foundation
722 if MONO_JEMALLOC_ENABLED
723 libmonoldflags += $(JEMALLOC_LDFLAGS)
726 libmono_ee_interp_la_SOURCES = $(interp_sources)
727 libmono_ee_interp_la_CFLAGS = $(AM_CFLAGS) @CXX_ADD_CFLAGS@ $(INTERP_CFLAGS)
729 libmono_ee_interp_la_LDFLAGS = $(libmonoldflags)
730 if DISABLE_INTERPRETER
731 libmono_ee_interp_la_LIBADD = libmonosgen-2.0.la
736 extra_libmono_dbg_source = debugger-engine.c
739 libmono_dbg_la_SOURCES = debugger-agent.c debugger-state-machine.c $(extra_libmono_dbg_source)
740 libmono_dbg_la_CFLAGS = $(AM_CFLAGS) @CXX_ADD_CFLAGS@
742 if DISABLE_DEBUGGER_AGENT
743 libmono_dbg_la_LIBADD = libmonosgen-2.0.la
747 dbg_libs = libmono-dbg.la
749 if DISABLE_DEBUGGER_AGENT
750 lib_LTLIBRARIES += $(dbg_libs)
753 if !DISABLE_DEBUGGER_AGENT
754 dbg_libs_with_mini = $(dbg_libs)
755 noinst_LTLIBRARIES += $(dbg_libs)
759 # This library is shared between mono and mono-sgen, since the code in mini/ doesn't contain
760 # compile time dependencies on boehm/sgen.
762 libmini_la_SOURCES = $(common_sources) $(llvm_sources) $(llvm_runtime_sources) $(arch_sources) $(os_sources)
763 libmini_la_CFLAGS = $(AM_CFLAGS) @CXX_ADD_CFLAGS@
765 libmonoboehm_2_0_la_SOURCES =
766 libmonoboehm_2_0_la_CFLAGS = $(mono_boehm_CFLAGS) @CXX_ADD_CFLAGS@
768 libmonoboehm_2_0_la_LIBADD = libmini.la $(interp_libs_with_mini) $(dbg_libs_with_mini) $(boehm_libs) $(LIBMONO_DTRACE_OBJECT) $(LLVMMONOF)
769 libmonoboehm_2_0_la_LDFLAGS = $(libmonoldflags) $(monobin_platform_ldflags) $(CCLDFLAGS)
771 libmonosgen_2_0_la_SOURCES =
772 libmonosgen_2_0_la_CFLAGS = $(mono_sgen_CFLAGS) @CXX_ADD_CFLAGS@
774 libmonosgen_2_0_la_LIBADD = libmini.la $(interp_libs_with_mini) $(dbg_libs_with_mini) $(sgen_libs) $(LIBMONO_DTRACE_OBJECT) $(LLVMMONOF)
775 libmonosgen_2_0_la_LDFLAGS = $(libmonoldflags) $(monobin_platform_ldflags) $(CCLDFLAGS)
776 libmonosgen_2_0_la_LIBTOOLFLAGS = $(MONO_LIBTOOL_TAG)
778 noinst_LIBRARIES += libmaintest.a
780 libmaintest_a_SOURCES = interp/whitebox.c
781 libmaintest_a_CFLAGS = $(AM_CFLAGS) @CXX_ADD_CFLAGS@
783 WHITEBOX_ASSEMBLY=interp/whitebox-snippets.exe
784 test_mono_interp_whitebox_SOURCES =
785 test_mono_interp_whitebox_CFLAGS = $(AM_CFLAGS) @CXX_REMOVE_CFLAGS@
786 test_mono_interp_whitebox_LDADD = interp/libmaintest_a-whitebox.$(OBJEXT) libmini.la $(interp_libs_with_mini) $(dbg_libs_with_mini) $(sgen_libs) $(LIBMONO_DTRACE_OBJECT) $(LLVMMONOF)
787 test_mono_interp_whitebox_LDFLAGS = $(libmonoldflags) $(monobin_platform_ldflags)
788 test_mono_interp_whitebox_DEPENDENCIES = $(WHITEBOX_ASSEMBLY)
790 check_PROGRAMS = test-mono-interp-whitebox
792 endif # !ENABLE_MSVC_ONLY
794 libmonoincludedir = $(includedir)/mono-$(API_VER)/mono/jit
796 # These are public headers.
797 # They should not use glib.h, G_BEGIN_DECLS, guint, etc.
798 # They should be wrapped in MONO_BEGIN_DECLS / MONO_END_DECLS.
799 libmonoinclude_HEADERS = \
801 mono-private-unstable.h
803 CSFLAGS = -unsafe -nowarn:0219,0169,0414,0649,0618
805 basic-simd.exe: basic-simd.cs TestDriver.dll
806 $(MCS) -out:$@ $(CSFLAGS) $< -r:TestDriver.dll -r:$(CLASS)/Mono.Simd.dll
808 basic-vectors.exe: basic-vectors.cs TestDriver.dll
809 $(MCS) -out:$@ $(CSFLAGS) $< -r:TestDriver.dll -r:$(CLASS)/System.Numerics.dll -r:$(CLASS)/System.Numerics.Vectors.dll
811 builtin-types.exe: builtin-types.cs TestDriver.dll
812 $(MCS) -out:$@ $(CSFLAGS) -define:ARCH_$(shell echo $$((8 * $(SIZEOF_VOID_P)))) $< -r:TestDriver.dll
814 nacl.exe: nacl.cs TestDriver.dll
815 $(MCS) -out:$@ $(CSFLAGS) $< -r:TestDriver.dll -r:$(CLASS)/Mono.Simd.dll
817 generics.exe: generics.cs TestDriver.dll generics-variant-types.dll
818 $(MCS) -out:$@ $(CSFLAGS) $< -r:TestDriver.dll -r:generics-variant-types.dll -r:$(CLASS)/System.Core.dll
820 unaligned.exe: unaligned.cs TestDriver.dll MemoryIntrinsics.dll
821 $(MCS) -out:$@ $(CSFLAGS) $< -r:TestDriver.dll -r:MemoryIntrinsics.dll
823 %.exe: %.cs TestDriver.dll
824 $(MCS) -out:$@ $(CSFLAGS) $< -r:TestDriver.dll
826 %.exe: %.il TestDriver.dll
827 $(ILASM) -output=$@ $<
829 TestDriver.dll: $(srcdir)/TestDriver.cs $(srcdir)/TestHelpers.cs
830 $(MCS) -out:$@ -target:library $^
832 generics-variant-types.dll: generics-variant-types.il
833 $(ILASM) -dll -output=$@ $<
835 MemoryIntrinsics.dll: MemoryIntrinsics.il
836 $(ILASM) -dll -output=$@ $<
840 GENMDESC_PRG=$(PYTHON) $(srcdir)/genmdesc.py $(target_define) $(srcdir)
842 cpu-wasm.h: mini-ops.h cpu-wasm.md $(srcdir)/genmdesc.py
843 $(GENMDESC_PRG) cpu-wasm.h wasm_desc $(srcdir)/cpu-wasm.md
845 cpu-x86.h: mini-ops.h cpu-x86.md $(srcdir)/genmdesc.py
846 $(GENMDESC_PRG) cpu-x86.h x86_desc $(srcdir)/cpu-x86.md
848 cpu-amd64.h: mini-ops.h cpu-amd64.md $(srcdir)/genmdesc.py
849 $(GENMDESC_PRG) cpu-amd64.h amd64_desc $(srcdir)/cpu-amd64.md
851 cpu-loongarch64.h: mini-ops.h cpu-loongarch64.md $(srcdir)/genmdesc.py
852 $(GENMDESC_PRG) cpu-loongarch64.h loongarch64_desc $(srcdir)/cpu-loongarch64.md
854 cpu-ppc.h: mini-ops.h cpu-ppc.md $(srcdir)/genmdesc.py
855 $(GENMDESC_PRG) cpu-ppc.h ppcg4 $(srcdir)/cpu-ppc.md
857 cpu-ppc64.h: mini-ops.h cpu-ppc64.md $(srcdir)/genmdesc.py
858 $(GENMDESC_PRG) cpu-ppc64.h ppc64_cpu_desc $(srcdir)/cpu-ppc64.md
860 cpu-arm.h: mini-ops.h cpu-arm.md $(srcdir)/genmdesc.py
861 $(GENMDESC_PRG) cpu-arm.h arm_cpu_desc $(srcdir)/cpu-arm.md
863 cpu-arm64.h: mini-ops.h cpu-arm64.md $(srcdir)/genmdesc.py
864 $(GENMDESC_PRG) cpu-arm64.h arm64_cpu_desc $(srcdir)/cpu-arm64.md
866 cpu-sparc.h: mini-ops.h cpu-sparc.md $(srcdir)/genmdesc.py
867 $(GENMDESC_PRG) cpu-sparc.h sparc_desc $(srcdir)/cpu-sparc.md
869 cpu-s390x.h: mini-ops.h cpu-s390x.md $(srcdir)/genmdesc.py
870 $(GENMDESC_PRG) cpu-s390x.h s390x_cpu_desc $(srcdir)/cpu-s390x.md
872 cpu-mips.h: mini-ops.h cpu-mips.md $(srcdir)/genmdesc.py
873 $(GENMDESC_PRG) cpu-mips.h mips_desc $(srcdir)/cpu-mips.md
875 cpu-riscv32.h: cpu-riscv32.md $(srcdir)/genmdesc.py
876 $(GENMDESC_PRG) cpu-riscv32.h riscv32_cpu_desc $(srcdir)/cpu-riscv32.md
878 cpu-riscv64.h: cpu-riscv64.md $(srcdir)/genmdesc.py
879 $(GENMDESC_PRG) cpu-riscv64.h riscv64_cpu_desc $(srcdir)/cpu-riscv64.md
882 $(MINI_RUNTIME) -v -v --ncompile 1 --compile Test:$(mtest) test.exe
884 test-local: $(regtests)
887 mkdir -p $(TEST_BUNDLE_PATH)/tests/mini
888 cp -L $(regtests) TestDriver.dll MemoryIntrinsics.dll generics-variant-types.dll $(TEST_BUNDLE_PATH)/tests/mini/
889 cp -L mono-sgen $(TEST_BUNDLE_PATH)/
890 chmod +x $(TEST_BUNDLE_PATH)/mono-sgen
892 cp -L mono-boehm $(TEST_BUNDLE_PATH)/
893 chmod +x $(TEST_BUNDLE_PATH)/mono-boehm
896 # ensure the tests are actually correct
897 checktests: $(regtests)
898 for i in $(regtests); do $(MINI_RUNTIME) $$i; done
900 rcheck-nunit: mono $(regtests)
901 $(MINI_RUNTIME) --regression $(regtests) > regressiontests.out 2>&1; cat regressiontests.out; \
902 if grep -q "100% pass" regressiontests.out; then successbool=True; failurescount=0; else successbool=False; failurescount=1; fi; \
903 echo "<?xml version='1.0' encoding='utf-8'?>\
904 <test-results failures='$$failurescount' total='1' not-run='0' name='regression-tests.dummy' date='$$(date +%F)' time='$$(date +%T)'>\
905 <test-suite name='regression-tests.dummy' success='$$successbool' time='0'>\
906 <results><test-case name='MonoTests.regressions.100percentsuccess' executed='True' success='$$successbool' time='0'>" > TestResult-regression.xml; \
907 if [ "$$successbool" = "False" ]; then echo "<failure><message><![CDATA[$$(cat regressiontests.out)]]></message><stack-trace></stack-trace></failure>" >> TestResult-regression.xml; fi; \
908 echo "</test-case></results>\
910 </test-results>" >> TestResult-regression.xml; exit $$failurescount
912 rcheck: mono $(regtests)
913 $(MINI_RUNTIME) --regression $(regtests)
915 richeck: mono $(regtests)
916 $(INTERP_RUNTIME) --regression $(regtests)
918 interp-whitebox: test-mono-interp-whitebox
919 MONO_PATH=$(CLASS) ./$< $(WHITEBOX_ASSEMBLY)
921 mixedcheck: mono mixed.exe
922 $(MINI_RUNTIME) --interp=jit=JitClass mixed.exe
926 # This test is fragile so disabled by default.
927 # single_imm_size support is incomplete.
928 # __declspec (thread) support breaks it.
929 # See https://github.com/mono/mono/pull/15599#issuecomment-509444313.
930 # See https://github.com/mono/mono/pull/15567.
931 # It was already previously disabled for ARM.
932 check-seq-points-force: mono $(regtests)
933 rm -f TestResult-op_il_seq_point.xml
934 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
935 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
936 $(srcdir)/test_op_il_seq_point_headerfooter.sh
938 gctest: mono gc-test.exe
939 MONO_DEBUG_OPTIONS=clear-nursery-at-gc $(MINI_RUNTIME) --regression gc-test.exe
941 LLVM_AOT_RUNTIME_OPTS=$(if $(LLVM),--llvm,)
942 LLVM_AOT_COMPILER_OPTS=mcpu=native
943 GSHAREDVT_RUNTIME_OPTS=$(if $(GSHAREDVT),-O=gsharedvt,)
945 aotcheck: mono $(regtests)
946 rm -rf *.exe.so *.exe.dylib *.exe.dylib.dSYM *.exe.dll
947 $(MINI_RUNTIME) $(LLVM_AOT_RUNTIME_OPTS) --aot="$(LLVM_AOT_COMPILER_OPTS)" $(regtests) || exit 1
948 for i in $(regtests); do $(RUNTIME_AOTCHECK) --regression $$i || exit 1; done
949 rm -rf *.exe.so *.exe.dylib *.exe.dylib.dSYM *.exe.dll
952 $(MAKE) aotcheck LLVM=1
955 $(MAKE) fullaotcheck GSHAREDVT=1
958 $(MAKE) fullaotcheck HYBRID=1
960 # FIXME: force preemptive suspend while interpreter doesn't support coop/hybird suspend
962 $(MAKE) fullaotcheck MIXED=1 MONO_THREADS_SUSPEND=preemptive
964 fullaot_regtests = $(regtests)
965 fullaot_testing_deps = generics-variant-types.dll TestDriver.dll MemoryIntrinsics.dll
966 fullaot_testing_deps_commas = generics-variant-types.dll,TestDriver.dll,MemoryIntrinsics.dll
968 FULLAOT_LIBS_UNIVERSAL = \
973 System.Security.dll \
976 System.Numerics.dll \
977 System.Numerics.Vectors.dll \
979 System.Configuration.dll
981 FULLAOT_LIBS_DISABLED =
983 # Skip aoting the tests that aren't compiled
984 # on the full aot profiles because they're skipped
987 FULLAOT_LIBS_DISABLED += \
989 System.Configuration.dll
991 if FULL_AOT_INTERP_TESTS
992 FULLAOT_LIBS_DISABLED += \
994 System.Configuration.dll
998 FULLAOT_LIBS = $(filter-out $(FULLAOT_LIBS_DISABLED),$(FULLAOT_LIBS_UNIVERSAL))
1000 FULLAOT_TMP_DIR=$(top_builddir)/mono/mini/fullaot-tmp
1002 # use the available testing profile
1003 FULLAOT_MONO_PATH=$(CLASS)
1005 FULLAOT_MONO_PATH=$(FULLAOT_TMP_DIR)
1008 FULLAOT_AOT_ARGS=$(if $(HYBRID),hybrid,full,interp),$(MONO_FULLAOT_ADDITIONAL_ARGS)$(INVARIANT_AOT_OPTIONS)
1009 FULLAOT_ARGS=$(if $(HYBRID),--hybrid-aot,--full-aot)
1011 # This currently only works on amd64/arm
1012 fullaotcheck: $(mono) $(fullaot_regtests) $(fullaot_testing_deps)
1013 rm -rf $(FULLAOT_TMP_DIR)
1014 mkdir $(FULLAOT_TMP_DIR)
1016 $(MAKE) fullaot-libs AOT_FLAGS="$(FULLAOT_AOT_ARGS)"
1018 cp $(fullaot_regtests) $(fullaot_testing_deps) $(FULLAOT_TMP_DIR)/
1019 MONO_PATH=$(FULLAOT_MONO_PATH) $(top_builddir)/runtime/mono-wrapper $(MOBILE_RUNTIME_ARG) $(LLVM_AOT_RUNTIME_OPTS) $(GSHAREDVT_RUNTIME_OPTS) --aot="$(FULLAOT_AOT_ARGS),$(LLVM_AOT_COMPILER_OPTS)" $(FULLAOT_TMP_DIR)/{$(fullaot_testing_deps_commas),*.exe} || exit 1
1020 ln -s $(if $(MONO_EXECUTABLE),$(MONO_EXECUTABLE),$$PWD/mono) $(FULLAOT_TMP_DIR)/
1021 for i in $(fullaot_regtests); do echo $$i; MONO_PATH=$(FULLAOT_MONO_PATH) $(top_builddir)/runtime/mono-wrapper $(MOBILE_RUNTIME_ARG) $(FULLAOT_ARGS) $(FULLAOT_TMP_DIR)/$$i --exclude '!FULLAOT' $(ARCH_FULLAOT_EXCLUDE) || exit 1; done
1022 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_MONO_PATH) 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
1024 # This can run in parallel
1025 fullaot-libs: $(patsubst %,fullaot-tmp/%.dylib,$(FULLAOT_LIBS))
1027 fullaot-tmp/%.dylib: $(CLASS)/%
1028 cp $(CLASS)/$* fullaot-tmp/
1029 mkdir fullaot-tmp/$*-tmp
1030 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/$*
1031 rm -rf fullaot-tmp/$*-tmp
1034 $(MAKE) fullaotcheck LLVM=1 GSHAREDVT=1
1036 llvmonly_regtests = $(fullaot_regtests) gshared.exe
1038 llvmonlycheck: mono $(llvmonly_regtests)
1041 $(MAKE) fullaot-libs AOT_FLAGS="llvmonly,clangxx=clang++-6.0,$(MONO_FULLAOT_ADDITIONAL_ARGS)$(INVARIANT_AOT_OPTIONS)"
1042 cp $(llvmonly_regtests) $(fullaot_testing_deps) fullaot-tmp/
1043 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
1044 ln -s $$PWD/mono fullaot-tmp/
1045 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
1047 gccheck: gc-test.exe
1048 MONO_GC_PARAMS=stack-mark=precise MONO_GC_DEBUG=clear-at-gc ./mono-sgen gc-test.exe
1050 bench: mono test.exe
1051 time env $(MINI_RUNTIME) --ncompile $(count) --compile Test:$(mtest) test.exe
1054 time $(monodir)/mono/jit/mono --ncompile $(count) --compile Test:$(mtest) test.exe
1056 stat1: mono bench.exe
1057 $(MINI_RUNTIME) --verbose --statfile stats.pl --regression bench.exe
1058 perl viewstat.pl stats.pl
1060 stat2: mono basic.exe
1061 $(MINI_RUNTIME) --verbose --statfile stats.pl --regression basic.exe
1062 perl viewstat.pl -e stats.pl
1064 stat3: mono bench.exe
1065 $(MINI_RUNTIME) --statfile stats.pl --ncompile 1000 --compile Tests:test_0_many_nested_loops bench.exe
1066 perl viewstat.pl stats.pl
1069 docbook2txt mini.sgm
1071 # We need these because automake can't process normal make conditionals
1072 check_local_targets = $(if $(EMIT_NUNIT), rcheck-nunit, rcheck)
1074 check-local: $(check_local_targets)
1077 rm -f mono mono.exe monow.exe mono-sgen.exe a.out gmon.out *.o buildver-boehm.h buildver-sgen.h test.exe regressionexitcode.out TestResult-op_il_seq_point.xml*
1079 pkgconfigdir = $(libdir)/pkgconfig
1081 BUILT_SOURCES = version.h $(arch_built)
1083 CLEANFILES= $(BUILT_SOURCES) *.exe *.dll
1084 EXTRA_DIST = TestDriver.cs \
1088 $(wasm_sources) cpu-wasm.md \
1089 $(x86_sources) cpu-x86.md \
1090 $(amd64_sources) cpu-amd64.md \
1091 $(loongarch64_sources) cpu-loongarch64.md \
1092 $(ppc_sources) cpu-ppc.md cpu-ppc64.md \
1093 $(arm_sources) cpu-arm.md \
1094 $(arm64_sources) cpu-arm64.md \
1095 $(mips_sources) cpu-mips.md \
1096 $(sparc_sources) cpu-sparc.md \
1097 $(s390x_sources) cpu-s390x.md \
1098 $(riscv_sources) cpu-riscv32.md cpu-riscv64.md \
1099 $(windows_sources) \
1100 $(darwin_sources) Info.plist \
1102 test_op_il_seq_point.sh \
1103 test_op_il_seq_point_headerfooter.sh \
1104 interp/whitebox-snippets.il \
1108 if test -e $(top_srcdir)/.git; then \
1109 (cd $(top_srcdir); \
1110 LANG=C; export LANG; \
1111 if test -z "$$ghprbPullId"; then \
1112 branch=`git branch | grep '^\*' | sed 's/.*detached .*/explicit/' | cut -d ' ' -f 2`; \
1114 branch="pull-request-$$ghprbPullId"; \
1116 version=`git log --no-color --first-parent -n1 --pretty=format:%h`; \
1117 echo "#define FULL_VERSION \"$$branch/$$version\""; \
1120 if test -z "$$MONO_BRANCH" -o -z "$$MONO_BUILD_REVISION"; then \
1121 echo "#define FULL_VERSION \"tarball\""; \
1123 echo "#define FULL_VERSION \"$$MONO_BRANCH/$$MONO_BUILD_REVISION\""; \
1127 # Utility target for patching libtool to speed up linking
1129 sed -e 's,if (for obj in $$oldobjs,if (for obj in "",g' < ../../libtool > 2; mv 2 ../../libtool
1130 chmod a+x ../../libtool
1132 # Utility target for patching libtool to get rid of the 'ranlib: file <file> has no symbols" warnings
1134 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
1135 chmod a+x ../../libtool
1137 # Utility target to patch automake to generate the same format silent output as the old mono silent build did
1139 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
1142 etags -o TAGS `find .. -name "*.h" -o -name "*.c"`
1145 llvm_makefile_dep = $(mono_build_root)/llvm/llvm_config.mk
1148 if HAS_EXTENSION_MODULE
1150 Makefile.am: Makefile.am.in
1151 echo "##################### Generated from Makefile.am.in, do not modify ##########################" > $@
1156 # Per-library because linking doesn't like -xc++, it treats libraries as C++.
1157 CFLAGS := $(filter-out @CXX_REMOVE_CFLAGS@, @CFLAGS@)