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@
214 lib_LTLIBRARIES += libmono-llvm.la
215 libmono_llvm_la_SOURCES = mini-llvm.c mini-llvm-cpp.cpp llvm-jit.cpp
216 libmono_llvm_la_LIBADD = $(glib_libs) $(LLVM_LIBS) $(LLVM_LDFLAGS)
217 libmono_llvm_la_CFLAGS = $(AM_CFLAGS) @CXX_ADD_CFLAGS@
220 libmono_llvm_la_LDFLAGS=-Wl,-undefined -Wl,suppress -Wl,-flat_namespace
224 # we need this to prevent automake from generating a default mono_SOURCES = mono.c
228 mono_boehm_CFLAGS = $(AM_CFLAGS) @CXX_REMOVE_CFLAGS@
230 AM_CPPFLAGS = $(LIBGC_CPPFLAGS)
233 mono_sgen_CFLAGS = $(AM_CFLAGS) @CXX_REMOVE_CFLAGS@
235 # We build this after libmono was built so it contains the date when the final
238 buildver-boehm.h: libmini.la $(monodir)/mono/metadata/libmonoruntime.la
239 @echo "const char *build_date = \"`date`\";" > buildver-boehm.h
240 libmain_a-main.$(OBJEXT): buildver-boehm.h
243 buildver-sgen.h: libmini.la $(monodir)/mono/metadata/libmonoruntimesgen.la $(monodir)/mono/sgen/libmonosgen.la
244 @echo "const char *build_date = \"`date`\";" > buildver-sgen.h
246 libmain_a-main-sgen.$(OBJEXT): buildver-sgen.h
249 LIBMONO_DTRACE_OBJECT = .libs/mono-dtrace.$(OBJEXT)
251 MONO_DTRACE_OBJECT = mono-dtrace.$(OBJEXT)
257 LIBMONO_DTRACE_OBJECT =
261 # Link libmono into mono statically
262 # This leads to higher performance, especially with TLS
263 MONO_LIB=$(boehm_static_libraries)
264 MONO_SGEN_LIB=$(sgen_static_libraries)
266 MONO_LIB=libmonoboehm-2.0.la
267 MONO_SGEN_LIB=libmonosgen-2.0.la
273 LLVMMONOF=$(LLVM_LIBS) $(LLVM_LDFLAGS)
277 libmain_a-main.$(OBJEXT) \
284 $(MONO_DTRACE_OBJECT)
286 mono_boehm_LDFLAGS = \
287 $(static_flags) $(monobinldflags) $(monobin_platform_ldflags)
290 libmain_a-main-sgen.$(OBJEXT) \
297 $(MONO_DTRACE_OBJECT)
300 mono_sgen_LDFLAGS = $(static_flags) $(monobinldflags) $(monobin_platform_ldflags)
302 if ENABLE_STATIC_GCC_LIBS
303 mono_sgen_LDFLAGS += -all-static
307 libmonoldflags += -no-undefined
312 # mono_LDADD = $(mono_sgen_LDADD)
313 # mono_LDFLAGS = $(mono_sgen_LDFLAGS)
320 mono-dtrace.$(OBJEXT): $(top_srcdir)/data/mono.d mini.lo $(monodir)/mono/metadata/libmonoruntime-static.la
321 DTRACE="$(DTRACE)" DTRACEFLAGS="$(DTRACEFLAGS)" AR="$(AR)" $(SHELL) $(top_srcdir)/data/dtrace-prelink.sh \
322 $@ $(top_srcdir)/data/mono.d $(monodir)/mono/metadata/libmonoruntime-static.la mini.lo
324 .libs/mono-dtrace.$(OBJEXT): $(top_srcdir)/data/mono.d mini.lo $(monodir)/mono/metadata/libmonoruntime.la
325 DTRACE="$(DTRACE)" DTRACEFLAGS="$(DTRACEFLAGS)" AR="$(AR)" $(SHELL) $(top_srcdir)/data/dtrace-prelink.sh \
326 --pic $@ $(top_srcdir)/data/mono.d $(monodir)/mono/metadata/libmonoruntime.la mini.lo
330 # Create monow.exe, linked for the 'windows' subsystem
333 monow_LDADD = $(mono_boehm_LDADD)
334 monow_LDFLAGS = $(mono_boehm_LDFLAGS) -mwindows
335 monow_SOURCES = $(mono_boehm_SOURCES)
337 monow_LDADD = $(mono_sgen_LDADD)
338 monow_LDFLAGS = $(mono_sgen_LDFLAGS) -mwindows
339 monow_SOURCES = $(mono_sgen_SOURCES)
346 mini-wasm-debugger.c \
356 mini-x86-gsharedvt.c \
357 tramp-x86-gsharedvt.c
364 mini-amd64-gsharedvt.c \
365 mini-amd64-gsharedvt.h \
366 tramp-amd64-gsharedvt.c
379 mini-arm-gsharedvt.c \
380 tramp-arm-gsharedvt.c
387 mini-arm64-gsharedvt.c \
388 mini-arm64-gsharedvt.h \
389 tramp-arm64-gsharedvt.c
421 mini-windows-tls-callback.c \
423 mini-windows-dllmain.c \
424 mini-windows-dlldac.c
444 interp/interp-internals.h \
452 interp_libs = libmono-ee-interp.la
454 if !DISABLE_INTERPRETER
455 interp_libs_with_mini = $(interp_libs)
459 llvm_runtime_sources = \
462 if ENABLE_LLVM_RUNTIME
463 llvm_runtime_sources = \
501 local-propagation.c \
509 wasm_m2n_invoke.g.h \
515 mini-generic-sharing.c \
517 simd-methods-netcore.h \
521 simd-intrinsics-netcore.c \
522 mini-native-types.c \
533 debugger-agent-stubs.c \
534 debugger-state-machine.h \
540 mini-cross-helpers.c \
559 endif # !ENABLE_MSVC_ONLY
561 # keep in sync with mcs/class/Mono.Runtime.Tests
573 devirtualization.cs \
577 generics-variant-types.il\
584 MemoryIntrinsics.il \
588 regtests_UNIVERSAL = \
601 devirtualization.exe \
611 regtests_DISABLED += builtin-types.exe
614 regtests = $(filter-out $(regtests_DISABLED),$(regtests_UNIVERSAL))
619 arch_sources = $(wasm_sources)
620 arch_built=cpu-wasm.h
622 target_define=TARGET_WASM
626 arch_sources = $(x86_sources)
629 target_define=TARGET_X86
633 arch_sources = $(amd64_sources)
634 arch_built=cpu-amd64.h
635 arch_define=__x86_64__
636 target_define=TARGET_AMD64
637 ARCH_FULLAOT_EXCLUDE=
641 arch_sources = $(ppc_sources)
644 target_define=TARGET_POWERPC
648 arch_sources = $(ppc_sources)
649 arch_built=cpu-ppc64.h
650 arch_define=__ppc64__
651 target_define=TARGET_POWERPC
655 arch_sources = $(mips_sources)
656 arch_built=cpu-mips.h
658 target_define=TARGET_MIPS
662 # pick up arm_dpimacros.h
663 ARCH_CFLAGS = -I../arch/arm
664 arch_sources = $(arm_sources)
667 target_define=TARGET_ARM
671 arch_sources = $(arm64_sources)
672 arch_built=cpu-arm64.h
673 arch_define=__aarch64__
674 target_define=TARGET_ARM64
678 arch_sources = $(sparc_sources)
679 arch_built=cpu-sparc.h
680 arch_define=__sparc__
681 target_define=TARGET_SPARC
685 arch_sources = $(sparc_sources)
686 arch_built=cpu-sparc.h
687 arch_define=__sparc__
688 target_define=TARGET_SPARC
692 arch_sources = $(s390x_sources)
693 arch_built=cpu-s390x.h
695 target_define=TARGET_S390X
699 arch_sources = $(riscv_sources)
700 arch_built = cpu-riscv32.h
701 arch_define = __riscv
702 target_define = TARGET_RISCV32
706 arch_sources = $(riscv_sources)
707 arch_built = cpu-riscv64.h
708 arch_define = __riscv
709 target_define = TARGET_RISCV64
713 os_sources = $(windows_sources)
714 monobin_platform_ldflags=
718 os_sources = $(posix_sources)
719 monobin_platform_ldflags=
723 os_sources = $(darwin_sources) $(posix_sources)
724 #monobin_platform_ldflags=-sectcreate __TEXT __info_plist $(top_srcdir)/mono/mini/Info.plist -framework CoreFoundation -framework Foundation
725 monobin_platform_ldflags=-framework CoreFoundation -framework Foundation
728 if MONO_JEMALLOC_ENABLED
729 libmonoldflags += $(JEMALLOC_LDFLAGS)
732 libmono_ee_interp_la_SOURCES = $(interp_sources)
733 libmono_ee_interp_la_CFLAGS = $(AM_CFLAGS) @CXX_ADD_CFLAGS@ $(INTERP_CFLAGS)
735 libmono_ee_interp_la_LDFLAGS = $(libmonoldflags)
736 if DISABLE_INTERPRETER
737 libmono_ee_interp_la_LIBADD = libmonosgen-2.0.la
742 extra_libmono_dbg_source = debugger-engine.c
745 libmono_dbg_la_SOURCES = debugger-agent.c debugger-state-machine.c $(extra_libmono_dbg_source)
746 libmono_dbg_la_CFLAGS = $(AM_CFLAGS) @CXX_ADD_CFLAGS@
748 if DISABLE_DEBUGGER_AGENT
749 libmono_dbg_la_LIBADD = libmonosgen-2.0.la
753 dbg_libs = libmono-dbg.la
755 if DISABLE_DEBUGGER_AGENT
756 lib_LTLIBRARIES += $(dbg_libs)
759 if !DISABLE_DEBUGGER_AGENT
760 dbg_libs_with_mini = $(dbg_libs)
761 noinst_LTLIBRARIES += $(dbg_libs)
765 # This library is shared between mono and mono-sgen, since the code in mini/ doesn't contain
766 # compile time dependencies on boehm/sgen.
768 libmini_la_SOURCES = $(common_sources) $(llvm_sources) $(llvm_runtime_sources) $(arch_sources) $(os_sources) $(netcore_sources)
769 libmini_la_CFLAGS = $(AM_CFLAGS) @CXX_ADD_CFLAGS@
771 libmonoboehm_2_0_la_SOURCES =
772 libmonoboehm_2_0_la_CFLAGS = $(mono_boehm_CFLAGS) @CXX_ADD_CFLAGS@
774 libmonoboehm_2_0_la_LIBADD = libmini.la $(interp_libs_with_mini) $(dbg_libs_with_mini) $(boehm_libs) $(LIBMONO_DTRACE_OBJECT) $(LLVMMONOF)
775 libmonoboehm_2_0_la_LDFLAGS = $(libmonoldflags) $(monobin_platform_ldflags)
777 libmonosgen_2_0_la_SOURCES =
778 libmonosgen_2_0_la_CFLAGS = $(mono_sgen_CFLAGS) @CXX_ADD_CFLAGS@
780 libmonosgen_2_0_la_LIBADD = libmini.la $(interp_libs_with_mini) $(dbg_libs_with_mini) $(sgen_libs) $(LIBMONO_DTRACE_OBJECT) $(LLVMMONOF)
781 libmonosgen_2_0_la_LDFLAGS = $(libmonoldflags) $(monobin_platform_ldflags)
783 noinst_LIBRARIES += libmaintest.a
785 libmaintest_a_SOURCES = interp/whitebox.c
786 libmaintest_a_CFLAGS = $(AM_CFLAGS) @CXX_ADD_CFLAGS@
788 WHITEBOX_ASSEMBLY=interp/whitebox-snippets.exe
789 test_mono_interp_whitebox_SOURCES =
790 test_mono_interp_whitebox_CFLAGS = $(AM_CFLAGS) @CXX_REMOVE_CFLAGS@
791 test_mono_interp_whitebox_LDADD = interp/libmaintest_a-whitebox.$(OBJEXT) libmini.la $(interp_libs_with_mini) $(dbg_libs_with_mini) $(sgen_libs)
792 test_mono_interp_whitebox_LDFLAGS = $(libmonoldflags) $(monobin_platform_ldflags)
793 test_mono_interp_whitebox_DEPENDENCIES = $(WHITEBOX_ASSEMBLY)
795 check_PROGRAMS = test-mono-interp-whitebox
797 endif # !ENABLE_MSVC_ONLY
799 libmonoincludedir = $(includedir)/mono-$(API_VER)/mono/jit
801 # These are public headers.
802 # They should not use glib.h, G_BEGIN_DECLS, guint, etc.
803 # They should be wrapped in MONO_BEGIN_DECLS / MONO_END_DECLS.
804 libmonoinclude_HEADERS = jit.h
806 CSFLAGS = -unsafe -nowarn:0219,0169,0414,0649,0618
808 basic-simd.exe: basic-simd.cs TestDriver.dll
809 $(MCS) -out:$@ $(CSFLAGS) $< -r:TestDriver.dll -r:$(CLASS)/Mono.Simd.dll
811 basic-vectors.exe: basic-vectors.cs TestDriver.dll
812 $(MCS) -out:$@ $(CSFLAGS) $< -r:TestDriver.dll -r:$(CLASS)/System.Numerics.dll -r:$(CLASS)/System.Numerics.Vectors.dll
814 builtin-types.exe: builtin-types.cs TestDriver.dll
815 $(MCS) -out:$@ $(CSFLAGS) -define:ARCH_$(shell echo $$((8 * $(SIZEOF_VOID_P)))) $< -r:TestDriver.dll
817 nacl.exe: nacl.cs TestDriver.dll
818 $(MCS) -out:$@ $(CSFLAGS) $< -r:TestDriver.dll -r:$(CLASS)/Mono.Simd.dll
820 generics.exe: generics.cs TestDriver.dll generics-variant-types.dll
821 $(MCS) -out:$@ $(CSFLAGS) $< -r:TestDriver.dll -r:generics-variant-types.dll -r:$(CLASS)/System.Core.dll
823 unaligned.exe: unaligned.cs TestDriver.dll MemoryIntrinsics.dll
824 $(MCS) -out:$@ $(CSFLAGS) $< -r:TestDriver.dll -r:MemoryIntrinsics.dll
826 %.exe: %.cs TestDriver.dll
827 $(MCS) -out:$@ $(CSFLAGS) $< -r:TestDriver.dll
830 $(ILASM) -output=$@ $<
832 TestDriver.dll: $(srcdir)/TestDriver.cs $(srcdir)/TestHelpers.cs
833 $(MCS) -out:$@ -target:library $^
835 generics-variant-types.dll: generics-variant-types.il
836 $(ILASM) -dll -output=$@ $<
838 MemoryIntrinsics.dll: MemoryIntrinsics.il
839 $(ILASM) -dll -output=$@ $<
843 GENMDESC_PRG=$(PYTHON) $(srcdir)/genmdesc.py $(target_define) $(srcdir)
845 cpu-wasm.h: mini-ops.h cpu-wasm.md $(srcdir)/genmdesc.py
846 $(GENMDESC_PRG) cpu-wasm.h wasm_desc $(srcdir)/cpu-wasm.md
848 cpu-x86.h: mini-ops.h cpu-x86.md $(srcdir)/genmdesc.py
849 $(GENMDESC_PRG) cpu-x86.h x86_desc $(srcdir)/cpu-x86.md
851 cpu-amd64.h: mini-ops.h cpu-amd64.md $(srcdir)/genmdesc.py
852 $(GENMDESC_PRG) cpu-amd64.h amd64_desc $(srcdir)/cpu-amd64.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,)
943 LLVM_AOT_COMPILER_OPTS=$(if $(LLVM),llvmllc=-mattr=+sse3,)
945 LLVM_AOT_COMPILER_OPTS=
947 GSHAREDVT_RUNTIME_OPTS=$(if $(GSHAREDVT),-O=gsharedvt,)
949 aotcheck: mono $(regtests)
950 rm -rf *.exe.so *.exe.dylib *.exe.dylib.dSYM *.exe.dll
951 $(MINI_RUNTIME) $(LLVM_AOT_RUNTIME_OPTS) --aot="$(LLVM_AOT_COMPILER_OPTS)" $(regtests) || exit 1
952 for i in $(regtests); do $(RUNTIME_AOTCHECK) --regression $$i || exit 1; done
953 rm -rf *.exe.so *.exe.dylib *.exe.dylib.dSYM *.exe.dll
956 $(MAKE) aotcheck LLVM=1
959 $(MAKE) fullaotcheck GSHAREDVT=1
962 $(MAKE) fullaotcheck HYBRID=1
964 # FIXME: force preemptive suspend while interpreter doesn't support coop/hybird suspend
966 $(MAKE) fullaotcheck MIXED=1 MONO_THREADS_SUSPEND=preemptive
968 fullaot_regtests = $(regtests)
969 fullaot_testing_deps = generics-variant-types.dll TestDriver.dll MemoryIntrinsics.dll
970 fullaot_testing_deps_commas = generics-variant-types.dll,TestDriver.dll,MemoryIntrinsics.dll
972 FULLAOT_LIBS_UNIVERSAL = \
977 System.Security.dll \
980 System.Numerics.dll \
981 System.Numerics.Vectors.dll \
983 System.Configuration.dll
985 FULLAOT_LIBS_DISABLED =
987 # Skip aoting the tests that aren't compiled
988 # on the full aot profiles because they're skipped
991 FULLAOT_LIBS_DISABLED += \
993 System.Configuration.dll
995 if FULL_AOT_INTERP_TESTS
996 FULLAOT_LIBS_DISABLED += \
998 System.Configuration.dll
1002 FULLAOT_LIBS = $(filter-out $(FULLAOT_LIBS_DISABLED),$(FULLAOT_LIBS_UNIVERSAL))
1004 FULLAOT_TMP_DIR=$(top_builddir)/mono/mini/fullaot-tmp
1006 # use the available testing profile
1007 FULLAOT_MONO_PATH=$(CLASS)
1009 FULLAOT_MONO_PATH=$(FULLAOT_TMP_DIR)
1012 FULLAOT_AOT_ARGS=$(if $(HYBRID),hybrid,full,interp),$(MONO_FULLAOT_ADDITIONAL_ARGS)$(INVARIANT_AOT_OPTIONS)
1013 FULLAOT_ARGS=$(if $(HYBRID),--hybrid-aot,--full-aot)
1015 # This currently only works on amd64/arm
1016 fullaotcheck: $(mono) $(fullaot_regtests) $(fullaot_testing_deps)
1017 rm -rf $(FULLAOT_TMP_DIR)
1018 mkdir $(FULLAOT_TMP_DIR)
1020 $(MAKE) fullaot-libs AOT_FLAGS="$(FULLAOT_AOT_ARGS)"
1022 cp $(fullaot_regtests) $(fullaot_testing_deps) $(FULLAOT_TMP_DIR)/
1023 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
1024 ln -s $(if $(MONO_EXECUTABLE),$(MONO_EXECUTABLE),$$PWD/mono) $(FULLAOT_TMP_DIR)/
1025 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
1026 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
1028 # This can run in parallel
1029 fullaot-libs: $(patsubst %,fullaot-tmp/%.dylib,$(FULLAOT_LIBS))
1031 fullaot-tmp/%.dylib: $(CLASS)/%
1032 cp $(CLASS)/$* fullaot-tmp/
1033 mkdir fullaot-tmp/$*-tmp
1034 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/$*
1035 rm -rf fullaot-tmp/$*-tmp
1038 $(MAKE) fullaotcheck LLVM=1 GSHAREDVT=1
1040 llvmonly_regtests = $(fullaot_regtests) gshared.exe
1042 llvmonlycheck: mono $(llvmonly_regtests)
1045 $(MAKE) fullaot-libs AOT_FLAGS="llvmonly,clangxx=clang++-6.0,$(MONO_FULLAOT_ADDITIONAL_ARGS)$(INVARIANT_AOT_OPTIONS)"
1046 cp $(llvmonly_regtests) $(fullaot_testing_deps) fullaot-tmp/
1047 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
1048 ln -s $$PWD/mono fullaot-tmp/
1049 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
1051 gccheck: gc-test.exe
1052 MONO_GC_PARAMS=stack-mark=precise MONO_GC_DEBUG=clear-at-gc ./mono-sgen gc-test.exe
1054 bench: mono test.exe
1055 time env $(MINI_RUNTIME) --ncompile $(count) --compile Test:$(mtest) test.exe
1058 time $(monodir)/mono/jit/mono --ncompile $(count) --compile Test:$(mtest) test.exe
1060 stat1: mono bench.exe
1061 $(MINI_RUNTIME) --verbose --statfile stats.pl --regression bench.exe
1062 perl viewstat.pl stats.pl
1064 stat2: mono basic.exe
1065 $(MINI_RUNTIME) --verbose --statfile stats.pl --regression basic.exe
1066 perl viewstat.pl -e stats.pl
1068 stat3: mono bench.exe
1069 $(MINI_RUNTIME) --statfile stats.pl --ncompile 1000 --compile Tests:test_0_many_nested_loops bench.exe
1070 perl viewstat.pl stats.pl
1073 docbook2txt mini.sgm
1075 # We need these because automake can't process normal make conditionals
1076 check_local_targets = $(if $(EMIT_NUNIT), rcheck-nunit, rcheck)
1078 check-local: $(check_local_targets)
1081 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*
1083 pkgconfigdir = $(libdir)/pkgconfig
1085 BUILT_SOURCES = version.h $(arch_built)
1087 CLEANFILES= $(BUILT_SOURCES) *.exe *.dll
1088 EXTRA_DIST = TestDriver.cs \
1092 $(wasm_sources) cpu-wasm.md \
1093 $(x86_sources) cpu-x86.md \
1094 $(amd64_sources) cpu-amd64.md \
1095 $(ppc_sources) cpu-ppc.md cpu-ppc64.md \
1096 $(arm_sources) cpu-arm.md \
1097 $(arm64_sources) cpu-arm64.md \
1098 $(mips_sources) cpu-mips.md \
1099 $(sparc_sources) cpu-sparc.md \
1100 $(s390x_sources) cpu-s390x.md \
1101 $(riscv_sources) cpu-riscv32.md cpu-riscv64.md \
1102 $(windows_sources) \
1103 $(darwin_sources) Info.plist \
1105 test_op_il_seq_point.sh \
1106 test_op_il_seq_point_headerfooter.sh \
1107 interp/whitebox-snippets.il \
1112 echo "#define FULL_VERSION \"netcore\"" > version.h
1115 if test -e $(top_srcdir)/.git; then \
1116 (cd $(top_srcdir); \
1117 LANG=C; export LANG; \
1118 if test -z "$$ghprbPullId"; then \
1119 branch=`git branch | grep '^\*' | sed 's/.*detached .*/explicit/' | cut -d ' ' -f 2`; \
1121 branch="pull-request-$$ghprbPullId"; \
1123 version=`git log --no-color --first-parent -n1 --pretty=format:%h`; \
1124 echo "#define FULL_VERSION \"$$branch/$$version\""; \
1127 if test -z "$$MONO_BRANCH" -o -z "$$MONO_BUILD_REVISION"; then \
1128 echo "#define FULL_VERSION \"tarball\""; \
1130 echo "#define FULL_VERSION \"$$MONO_BRANCH/$$MONO_BUILD_REVISION\""; \
1135 # Utility target for patching libtool to speed up linking
1137 sed -e 's,if (for obj in $$oldobjs,if (for obj in "",g' < ../../libtool > 2; mv 2 ../../libtool
1138 chmod a+x ../../libtool
1140 # Utility target for patching libtool to get rid of the 'ranlib: file <file> has no symbols" warnings
1142 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
1143 chmod a+x ../../libtool
1145 # Utility target to patch automake to generate the same format silent output as the old mono silent build did
1147 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
1150 etags -o TAGS `find .. -name "*.h" -o -name "*.c"`
1153 llvm_makefile_dep = $(mono_build_root)/llvm/llvm_config.mk
1156 if HAS_EXTENSION_MODULE
1158 Makefile.am: Makefile.am.in
1159 echo "##################### Generated from Makefile.am.in, do not modify ##########################" > $@
1164 # Per-library because linking doesn't like -xc++, it treats libraries as C++.
1165 CFLAGS := $(filter-out @CXX_REMOVE_CFLAGS@, @CFLAGS@)