1 include $(top_srcdir)/mk/common.mk
5 monodir=$(top_builddir)
6 mono=$(if $(MONO_EXECUTABLE),$(MONO_EXECUTABLE),mono)
9 PLATFORM_PATH_SEPARATOR=;
11 PLATFORM_PATH_SEPARATOR=:
14 # This is needed for automake dependency generation
19 libgc_libs=$(monodir)/libgc/libmonogc.la
20 libgc_static_libs=$(monodir)/libgc/libmonogc-static.la
23 glib_libs = $(monodir)/mono/eglib/libeglib.la
26 $(monodir)/mono/metadata/libmonoruntime.la \
27 $(monodir)/mono/utils/libmonoutils.la \
32 $(monodir)/mono/metadata/libmonoruntimesgen.la \
33 $(monodir)/mono/sgen/libmonosgen.la \
34 $(monodir)/mono/utils/libmonoutils.la \
38 -include $(mono_build_root)/llvm/llvm_config.mk
39 LLVM_CFLAGS=$(LLVM_CFLAGS_INTERNAL) $(LLVM_CFLAGS_EXTERNAL)
40 LLVM_CXXFLAGS=$(LLVM_CXXFLAGS_INTERNAL) $(LLVM_CXXFLAGS_EXTERNAL)
41 LLVM_LDFLAGS=$(LLVM_LDFLAGS_INTERNAL) $(LLVM_LDFLAGS_EXTERNAL)
42 LLVM_LIBS=$(LLVM_LIBS_INTERNAL) $(LLVM_LIBS_EXTERNAL)
45 echo "cflags: $(LLVM_CFLAGS)"
46 echo "cxxflags: $(LLVM_CXXFLAGS)"
47 echo "ldflags: $(LLVM_LDFLAGS)"
48 echo "libs: $(LLVM_LIBS)"
53 # if the tests are going to run with framework assemblies compiled with
54 # -d:MOBILE, tell the runtime to remap framework assemblies using the mobile
56 MOBILE_RUNTIME_ARG=--runtime=mobile
61 CLASS=$(mcs_topdir)/class/lib/$(DEFAULT_PROFILE)
63 RUNTIME_EXECUTABLE = $(if $(BOEHM),$(top_builddir)/mono/mini/mono-boehm,$(top_builddir)/runtime/mono-wrapper)
65 MINI_RUNTIME = MONO_PATH=$(CLASS) $(RUNTIME_EXECUTABLE) $(MOBILE_RUNTIME_ARG)
66 TOOLS_RUNTIME = MONO_PATH=$(mcs_topdir)/class/lib/build $(top_builddir)/runtime/mono-wrapper
67 INTERP_RUNTIME = $(MINI_RUNTIME) --interpreter
68 RUNTIME_AOTCHECK = MONO_PATH="$(CLASS)$(PLATFORM_PATH_SEPARATOR)." $(RUNTIME_EXECUTABLE)
70 MCS = CSC_SDK_PATH_DISABLED= $(TOOLS_RUNTIME) $(CSC) -langversion:7.2 -unsafe -nowarn:0162 -nologo -noconfig -r:$(CLASS)/mscorlib.dll -r:$(CLASS)/System.dll -r:$(CLASS)/System.Core.dll
71 ILASM = $(TOOLS_RUNTIME) $(mcs_topdir)/class/lib/build/ilasm.exe
78 $(PLATFORM_CFLAGS) $(ARCH_CFLAGS) $(SHARED_CFLAGS)
80 AM_CXXFLAGS = $(LLVM_CXXFLAGS) $(GLIB_CFLAGS)
84 # The mingw math.h has "extern inline" functions that dont appear in libs, so
85 # optimisation is required to actually inline them
89 monoldflags=$(export_ldflags)
90 monobinldflags=$(export_ldflags) $(extra_runtime_ldflags)
93 libmonoldflags=-no-undefined -avoid-version -Wl,--kill-at $(monoldflags)
96 libmonoldflags= -avoid-version $(monoldflags)
98 libmonoldflags=$(monoldflags) -version-info 1:0:0
103 sgen_binaries = mono-sgen
104 sgen_libraries = libmonosgen-2.0.la
105 sgen_static_libraries = libmini.la $(interp_libs_with_mini) $(dbg_libs_with_mini) $(sgen_libs)
109 boehm_libraries = libmonoboehm-2.0.la
110 boehm_static_libraries = libmini.la $(interp_libs_with_mini) $(dbg_libs_with_mini) $(boehm_libs)
111 boehm_binaries = mono-boehm
115 mono_bin_suffix = sgen
116 libmono_suffix = sgen
118 mono_bin_suffix = boehm
119 libmono_suffix = boehm
122 if DISABLE_EXECUTABLES
124 mono: mono-$(mono_bin_suffix)
127 mono.exe: mono-$(mono_bin_suffix).exe
131 (cd $(DESTDIR)$(bindir) && ln -sf mono-$(mono_bin_suffix) mono)
132 (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)
135 if DISABLE_EXECUTABLES
138 bin_PROGRAMS = $(boehm_binaries) $(sgen_binaries) monow
140 bin_PROGRAMS = $(boehm_binaries) $(sgen_binaries)
144 if DISABLE_EXECUTABLES
147 noinst_PROGRAMS = mono
150 if DISABLE_EXECUTABLES
151 shared_libraries = $(boehm_libraries) $(sgen_libraries)
154 shared_libraries = $(boehm_libraries) $(sgen_libraries)
158 lib_LTLIBRARIES = $(shared_libraries)
160 if DISABLE_INTERPRETER
161 lib_LTLIBRARIES += $(interp_libs)
165 mini_common_lib = libmini.la
170 noinst_LTLIBRARIES = $(mini_common_lib)
172 noinst_LIBRARIES = libmain.a
174 libmain_a_SOURCES = main-sgen.c
176 libmain_a_SOURCES += main.c
178 libmain_a_CFLAGS = $(AM_CFLAGS) @CXX_ADD_CFLAGS@
181 lib_LTLIBRARIES += libmono-llvm.la
182 libmono_llvm_la_SOURCES = mini-llvm.c mini-llvm-cpp.cpp llvm-jit.cpp
183 libmono_llvm_la_LIBADD = $(glib_libs) $(LLVM_LIBS) $(LLVM_LDFLAGS)
186 libmono_llvm_la_LDFLAGS=-Wl,-undefined -Wl,suppress -Wl,-flat_namespace
191 mono_boehm_CFLAGS = $(AM_CFLAGS) @CXX_REMOVE_CFLAGS@
193 AM_CPPFLAGS = $(LIBGC_CPPFLAGS)
196 mono_sgen_CFLAGS = $(AM_CFLAGS) @CXX_REMOVE_CFLAGS@
198 # We build this after libmono was built so it contains the date when the final
201 buildver-boehm.h: libmini.la $(monodir)/mono/metadata/libmonoruntime.la
202 @echo "const char *build_date = \"`date`\";" > buildver-boehm.h
203 libmain_a-main.$(OBJEXT): buildver-boehm.h
206 buildver-sgen.h: libmini.la $(monodir)/mono/metadata/libmonoruntimesgen.la $(monodir)/mono/sgen/libmonosgen.la
207 @echo "const char *build_date = \"`date`\";" > buildver-sgen.h
209 libmain_a-main-sgen.$(OBJEXT): buildver-sgen.h
212 LIBMONO_DTRACE_OBJECT = .libs/mono-dtrace.$(OBJEXT)
214 MONO_DTRACE_OBJECT = mono-dtrace.$(OBJEXT)
220 LIBMONO_DTRACE_OBJECT =
224 # Link libmono into mono statically
225 # This leads to higher performance, especially with TLS
226 MONO_LIB=$(boehm_static_libraries)
227 MONO_SGEN_LIB=$(sgen_static_libraries)
229 MONO_LIB=libmonoboehm-2.0.la
230 MONO_SGEN_LIB=libmonosgen-2.0.la
236 LLVMMONOF=$(LLVM_LIBS) $(LLVM_LDFLAGS)
240 libmain_a-main.$(OBJEXT) \
245 $(MONO_DTRACE_OBJECT)
247 mono_boehm_LDFLAGS = \
248 $(static_flags) $(monobinldflags) $(monobin_platform_ldflags)
251 libmain_a-main-sgen.$(OBJEXT) \
256 $(MONO_DTRACE_OBJECT)
258 mono_sgen_LDFLAGS = $(static_flags) $(monobinldflags) $(monobin_platform_ldflags)
261 libmonoldflags += -no-undefined
266 # mono_LDADD = $(mono_sgen_LDADD)
267 # mono_LDFLAGS = $(mono_sgen_LDFLAGS)
274 mono-dtrace.$(OBJEXT): $(top_srcdir)/data/mono.d mini.lo $(monodir)/mono/metadata/libmonoruntime-static.la
275 DTRACE="$(DTRACE)" DTRACEFLAGS="$(DTRACEFLAGS)" AR="$(AR)" $(SHELL) $(top_srcdir)/data/dtrace-prelink.sh \
276 $@ $(top_srcdir)/data/mono.d $(monodir)/mono/metadata/libmonoruntime-static.la mini.lo
278 .libs/mono-dtrace.$(OBJEXT): $(top_srcdir)/data/mono.d mini.lo $(monodir)/mono/metadata/libmonoruntime.la
279 DTRACE="$(DTRACE)" DTRACEFLAGS="$(DTRACEFLAGS)" AR="$(AR)" $(SHELL) $(top_srcdir)/data/dtrace-prelink.sh \
280 --pic $@ $(top_srcdir)/data/mono.d $(monodir)/mono/metadata/libmonoruntime.la mini.lo
284 # Create monow.exe, linked for the 'windows' subsystem
287 monow_LDADD = $(mono_boehm_LDADD)
288 monow_LDFLAGS = $(mono_boehm_LDFLAGS) -mwindows
289 monow_SOURCES = $(mono_boehm_SOURCES)
291 monow_LDADD = $(mono_sgen_LDADD)
292 monow_LDFLAGS = $(mono_sgen_LDFLAGS) -mwindows
293 monow_SOURCES = $(mono_sgen_SOURCES)
300 mini-wasm-debugger.c \
310 mini-x86-gsharedvt.c \
311 tramp-x86-gsharedvt.c
318 mini-amd64-gsharedvt.c \
319 mini-amd64-gsharedvt.h \
320 tramp-amd64-gsharedvt.c
333 mini-arm-gsharedvt.c \
334 tramp-arm-gsharedvt.c
341 mini-arm64-gsharedvt.c \
342 mini-arm64-gsharedvt.h \
343 tramp-arm64-gsharedvt.c
370 mini-windows-dllmain.c \
371 mini-windows-dlldac.c
392 interp/interp-internals.h \
399 interp_libs = libmono-ee-interp.la
401 if !DISABLE_INTERPRETER
402 interp_libs_with_mini = $(interp_libs)
406 llvm_runtime_sources = \
409 if ENABLE_LLVM_RUNTIME
410 llvm_runtime_sources = \
443 local-propagation.c \
451 wasm_m2n_invoke.g.h \
457 mini-generic-sharing.c \
462 mini-native-types.c \
473 debugger-agent-stubs.c \
474 debugger-state-machine.h \
480 mini-cross-helpers.c \
505 devirtualization.cs \
509 generics-variant-types.il\
516 MemoryIntrinsics.il \
520 regtests_UNIVERSAL = \
533 devirtualization.exe \
543 regtests_DISABLED += builtin-types.exe
546 regtests = $(filter-out $(regtests_DISABLED),$(regtests_UNIVERSAL))
549 arch_sources = $(wasm_sources)
550 arch_built=cpu-wasm.h
552 target_define=TARGET_WASM
556 arch_sources = $(x86_sources)
559 target_define=TARGET_X86
563 arch_sources = $(amd64_sources)
564 arch_built=cpu-amd64.h
565 arch_define=__x86_64__
566 target_define=TARGET_AMD64
567 ARCH_FULLAOT_EXCLUDE=
571 arch_sources = $(ppc_sources)
574 target_define=TARGET_POWERPC
578 arch_sources = $(ppc_sources)
579 arch_built=cpu-ppc64.h
580 arch_define=__ppc64__
581 target_define=TARGET_POWERPC
585 arch_sources = $(mips_sources)
586 arch_built=cpu-mips.h
588 target_define=TARGET_MIPS
592 # pick up arm_dpimacros.h
593 ARCH_CFLAGS = -I../arch/arm
594 arch_sources = $(arm_sources)
597 target_define=TARGET_ARM
601 arch_sources = $(arm64_sources)
602 arch_built=cpu-arm64.h
603 arch_define=__aarch64__
604 target_define=TARGET_ARM64
608 arch_sources = $(sparc_sources)
609 arch_built=cpu-sparc.h
610 arch_define=__sparc__
611 target_define=TARGET_SPARC
615 arch_sources = $(sparc_sources)
616 arch_built=cpu-sparc.h
617 arch_define=__sparc__
618 target_define=TARGET_SPARC
622 arch_sources = $(s390x_sources)
623 arch_built=cpu-s390x.h
625 target_define=TARGET_S390X
629 os_sources = $(windows_sources)
630 monobin_platform_ldflags=
634 os_sources = $(posix_sources)
635 monobin_platform_ldflags=
639 os_sources = $(darwin_sources) $(posix_sources)
640 #monobin_platform_ldflags=-sectcreate __TEXT __info_plist $(top_srcdir)/mono/mini/Info.plist -framework CoreFoundation -framework Foundation
641 monobin_platform_ldflags=-framework CoreFoundation -framework Foundation
644 if MONO_JEMALLOC_ENABLED
645 libmonoldflags += $(JEMALLOC_LDFLAGS)
648 libmono_ee_interp_la_SOURCES = $(interp_sources)
649 libmono_ee_interp_la_CFLAGS = $(AM_CFLAGS) @CXX_ADD_CFLAGS@
651 libmono_ee_interp_la_LDFLAGS = $(libmonoldflags)
652 if DISABLE_INTERPRETER
653 libmono_ee_interp_la_LIBADD = libmonosgen-2.0.la
658 extra_libmono_dbg_source = debugger-engine.c
661 libmono_dbg_la_SOURCES = debugger-agent.c debugger-state-machine.c $(extra_libmono_dbg_source)
662 libmono_dbg_la_CFLAGS = $(AM_CFLAGS) @CXX_ADD_CFLAGS@
664 if DISABLE_DEBUGGER_AGENT
665 libmono_dbg_la_LIBADD = libmonosgen-2.0.la
669 dbg_libs = libmono-dbg.la
671 if DISABLE_DEBUGGER_AGENT
672 lib_LTLIBRARIES += $(dbg_libs)
675 if !DISABLE_DEBUGGER_AGENT
676 dbg_libs_with_mini = $(dbg_libs)
677 noinst_LTLIBRARIES += $(dbg_libs)
681 # This library is shared between mono and mono-sgen, since the code in mini/ doesn't contain
682 # compile time dependencies on boehm/sgen.
684 libmini_la_SOURCES = $(common_sources) $(llvm_sources) $(llvm_runtime_sources) $(arch_sources) $(os_sources)
685 libmini_la_CFLAGS = $(AM_CFLAGS) @CXX_ADD_CFLAGS@
687 libmonoboehm_2_0_la_SOURCES =
688 libmonoboehm_2_0_la_CFLAGS = $(mono_boehm_CFLAGS) @CXX_ADD_CFLAGS@
690 libmonoboehm_2_0_la_LIBADD = libmini.la $(interp_libs_with_mini) $(dbg_libs_with_mini) $(boehm_libs) $(LIBMONO_DTRACE_OBJECT) $(LLVMMONOF)
691 libmonoboehm_2_0_la_LDFLAGS = $(libmonoldflags) $(monobin_platform_ldflags)
693 libmonosgen_2_0_la_SOURCES =
694 libmonosgen_2_0_la_CFLAGS = $(mono_sgen_CFLAGS) @CXX_ADD_CFLAGS@
696 libmonosgen_2_0_la_LIBADD = libmini.la $(interp_libs_with_mini) $(dbg_libs_with_mini) $(sgen_libs) $(LIBMONO_DTRACE_OBJECT) $(LLVMMONOF)
697 libmonosgen_2_0_la_LDFLAGS = $(libmonoldflags) $(monobin_platform_ldflags)
699 libmonoincludedir = $(includedir)/mono-$(API_VER)/mono/jit
701 # These are public headers.
702 # They should not use glib.h, G_BEGIN_DECLS, guint, etc.
703 # They should be wrapped in MONO_BEGIN_DECLS / MONO_END_DECLS.
704 libmonoinclude_HEADERS = jit.h
706 CSFLAGS = -unsafe -nowarn:0219,0169,0414,0649,0618
708 basic-simd.exe: basic-simd.cs TestDriver.dll
709 $(MCS) -out:$@ $(CSFLAGS) $< -r:TestDriver.dll -r:$(CLASS)/Mono.Simd.dll
711 basic-vectors.exe: basic-vectors.cs TestDriver.dll
712 $(MCS) -out:$@ $(CSFLAGS) $< -r:TestDriver.dll -r:$(CLASS)/System.Numerics.dll -r:$(CLASS)/System.Numerics.Vectors.dll
714 builtin-types.exe: builtin-types.cs TestDriver.dll
715 $(MCS) -out:$@ $(CSFLAGS) -define:ARCH_$(shell echo $$((8 * $(SIZEOF_VOID_P)))) $< -r:TestDriver.dll
717 nacl.exe: nacl.cs TestDriver.dll
718 $(MCS) -out:$@ $(CSFLAGS) $< -r:TestDriver.dll -r:$(CLASS)/Mono.Simd.dll
720 generics.exe: generics.cs TestDriver.dll generics-variant-types.dll
721 $(MCS) -out:$@ $(CSFLAGS) $< -r:TestDriver.dll -r:generics-variant-types.dll -r:$(CLASS)/System.Core.dll
723 unaligned.exe: unaligned.cs TestDriver.dll MemoryIntrinsics.dll
724 $(MCS) -out:$@ $(CSFLAGS) $< -r:TestDriver.dll -r:MemoryIntrinsics.dll
726 %.exe: %.cs TestDriver.dll
727 $(MCS) -out:$@ $(CSFLAGS) $< -r:TestDriver.dll
730 $(ILASM) -output=$@ $<
732 TestDriver.dll: $(srcdir)/TestDriver.cs $(srcdir)/TestHelpers.cs
733 $(MCS) -out:$@ -target:library $^
735 generics-variant-types.dll: generics-variant-types.il
736 $(ILASM) -dll -output=$@ $<
738 MemoryIntrinsics.dll: MemoryIntrinsics.il
739 $(ILASM) -dll -output=$@ $<
743 GENMDESC_PRG=python $(srcdir)/genmdesc.py $(target_define) $(srcdir)
745 cpu-wasm.h: mini-ops.h cpu-wasm.md
746 $(GENMDESC_PRG) cpu-wasm.h wasm_desc $(srcdir)/cpu-wasm.md
748 cpu-x86.h: mini-ops.h cpu-x86.md
749 $(GENMDESC_PRG) cpu-x86.h x86_desc $(srcdir)/cpu-x86.md
751 cpu-amd64.h: mini-ops.h cpu-amd64.md
752 $(GENMDESC_PRG) cpu-amd64.h amd64_desc $(srcdir)/cpu-amd64.md
754 cpu-ppc.h: mini-ops.h cpu-ppc.md
755 $(GENMDESC_PRG) cpu-ppc.h ppcg4 $(srcdir)/cpu-ppc.md
757 cpu-ppc64.h: mini-ops.h cpu-ppc64.md
758 $(GENMDESC_PRG) cpu-ppc64.h ppc64_cpu_desc $(srcdir)/cpu-ppc64.md
760 cpu-arm.h: mini-ops.h cpu-arm.md
761 $(GENMDESC_PRG) cpu-arm.h arm_cpu_desc $(srcdir)/cpu-arm.md
763 cpu-arm64.h: mini-ops.h cpu-arm64.md
764 $(GENMDESC_PRG) cpu-arm64.h arm64_cpu_desc $(srcdir)/cpu-arm64.md
766 cpu-sparc.h: mini-ops.h cpu-sparc.md
767 $(GENMDESC_PRG) cpu-sparc.h sparc_desc $(srcdir)/cpu-sparc.md
769 cpu-s390x.h: mini-ops.h cpu-s390x.md
770 $(GENMDESC_PRG) cpu-s390x.h s390x_cpu_desc $(srcdir)/cpu-s390x.md
772 cpu-mips.h: mini-ops.h cpu-mips.md
773 $(GENMDESC_PRG) cpu-mips.h mips_desc $(srcdir)/cpu-mips.md
776 $(MINI_RUNTIME) -v -v --ncompile 1 --compile Test:$(mtest) test.exe
778 # ensure the tests are actually correct
779 checktests: $(regtests)
780 for i in $(regtests); do $(MINI_RUNTIME) $$i; done
782 rcheck-nunit: mono $(regtests)
783 $(MINI_RUNTIME) --regression $(regtests) > regressiontests.out 2>&1; cat regressiontests.out; \
784 if grep -q "100% pass" regressiontests.out; then successbool=True; failurescount=0; else successbool=False; failurescount=1; fi; \
785 echo "<?xml version='1.0' encoding='utf-8'?>\
786 <test-results failures='$$failurescount' total='1' not-run='0' name='regression-tests.dummy' date='$$(date +%F)' time='$$(date +%T)'>\
787 <test-suite name='regression-tests.dummy' success='$$successbool' time='0'>\
788 <results><test-case name='MonoTests.regressions.100percentsuccess' executed='True' success='$$successbool' time='0'>" > TestResult-regression.xml; \
789 if [ "$$successbool" = "False" ]; then echo "<failure><message><![CDATA[$$(cat regressiontests.out)]]></message><stack-trace></stack-trace></failure>" >> TestResult-regression.xml; fi; \
790 echo "</test-case></results>\
792 </test-results>" >> TestResult-regression.xml; exit $$failurescount
794 rcheck: mono $(regtests)
795 $(MINI_RUNTIME) --regression $(regtests)
797 richeck: mono $(regtests)
798 $(INTERP_RUNTIME) --regression $(regtests)
800 mixedcheck: mono mixed.exe
801 $(MINI_RUNTIME) --interp=jit=JitClass mixed.exe
806 check-seq-points: mono $(regtests)
807 rm -f TestResult-op_il_seq_point.xml
808 for i in $(regtests); do $(srcdir)/test_op_il_seq_point.sh $$i || ($(srcdir)/test_op_il_seq_point_headerfooter.sh; exit 1) || exit 1; done
809 for i in $(regtests); do $(srcdir)/test_op_il_seq_point.sh $$i --aot || ($(srcdir)/test_op_il_seq_point_headerfooter.sh; exit 1) || exit 1; done
810 $(srcdir)/test_op_il_seq_point_headerfooter.sh
813 gctest: mono gc-test.exe
814 MONO_DEBUG_OPTIONS=clear-nursery-at-gc $(MINI_RUNTIME) --regression gc-test.exe
816 LLVM_AOT_RUNTIME_OPTS=$(if $(LLVM),--llvm,)
817 GSHAREDVT_RUNTIME_OPTS=$(if $(GSHAREDVT),-O=gsharedvt,)
819 aotcheck: mono $(regtests)
820 rm -rf *.exe.so *.exe.dylib *.exe.dylib.dSYM
821 $(MINI_RUNTIME) $(LLVM_AOT_RUNTIME_OPTS) --aot $(regtests) || exit 1
822 for i in $(regtests); do $(RUNTIME_AOTCHECK) --regression $$i || exit 1; done
823 rm -rf *.exe.so *.exe.dylib *.exe.dylib.dSYM
826 $(MAKE) aotcheck LLVM=1
829 $(MAKE) fullaotcheck GSHAREDVT=1
832 $(MAKE) fullaotcheck HYBRID=1
834 # FIXME: force preemptive suspend while interpreter doesn't support coop/hybird suspend
836 $(MAKE) fullaotcheck MIXED=1 MONO_THREADS_SUSPEND=preemptive
838 fullaot_regtests = $(regtests)
839 fullaot_testing_deps = generics-variant-types.dll TestDriver.dll MemoryIntrinsics.dll
840 fullaot_testing_deps_commas = generics-variant-types.dll,TestDriver.dll,MemoryIntrinsics.dll
842 FULLAOT_LIBS_UNIVERSAL = \
847 System.Security.dll \
850 System.Numerics.dll \
851 System.Numerics.Vectors.dll \
853 System.Configuration.dll
855 FULLAOT_LIBS_DISABLED =
858 # Skip aoting the tests that aren't compiled
859 # on the full aot profiles because they're skipped
861 FULLAOT_LIBS_DISABLED += \
863 System.Configuration.dll
867 FULLAOT_LIBS = $(filter-out $(FULLAOT_LIBS_DISABLED),$(FULLAOT_LIBS_UNIVERSAL))
869 FULLAOT_TMP_DIR=$(top_builddir)/mono/mini/fullaot-tmp
871 FULLAOT_AOT_ARGS=$(if $(HYBRID),hybrid,full,interp)
872 FULLAOT_ARGS=$(if $(HYBRID),--hybrid-aot,--full-aot)
874 # This currently only works on amd64/arm
875 fullaotcheck: $(mono) $(fullaot_regtests) $(fullaot_testing_deps)
876 rm -rf $(FULLAOT_TMP_DIR)
877 mkdir $(FULLAOT_TMP_DIR)
878 $(MAKE) fullaot-libs AOT_FLAGS="$(FULLAOT_AOT_ARGS),$(MONO_FULLAOT_ADDITIONAL_ARGS)$(INVARIANT_AOT_OPTIONS)" GSHAREDVT=$(GSHAREDVT)
879 cp $(regtests) $(fullaot_regtests) $(fullaot_testing_deps) $(FULLAOT_TMP_DIR)/
880 MONO_PATH=$(FULLAOT_TMP_DIR) $(top_builddir)/runtime/mono-wrapper $(MOBILE_RUNTIME_ARG) $(LLVM_AOT_RUNTIME_OPTS) $(GSHAREDVT_RUNTIME_OPTS) --aot="$(FULLAOT_AOT_ARGS),$(MONO_FULLAOT_ADDITIONAL_ARGS)$(INVARIANT_AOT_OPTIONS)" $(FULLAOT_TMP_DIR)/{$(fullaot_testing_deps_commas),*.exe} || exit 1
881 ln -s $(if $(MONO_EXECUTABLE),$(MONO_EXECUTABLE),$$PWD/mono) $(FULLAOT_TMP_DIR)/
882 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
883 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 ./mono --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
885 # This can run in parallel
886 fullaot-libs: $(patsubst %,fullaot-tmp/%.dylib,$(FULLAOT_LIBS))
888 fullaot-tmp/%.dylib: $(CLASS)/%
889 cp $(CLASS)/$* fullaot-tmp/
890 mkdir fullaot-tmp/$*-tmp
891 MONO_PATH="fullaot-tmp/$(PLATFORM_PATH_SEPARATOR)$(CLASS)" $(top_builddir)/runtime/mono-wrapper $(MOBILE_RUNTIME_ARG) $(if $(GSHAREDVT),-O=gsharedvt) --aot=$(AOT_FLAGS),temp-path=fullaot-tmp/$*-tmp fullaot-tmp/$*
892 rm -rf fullaot-tmp/$*-tmp
895 $(MAKE) fullaotcheck LLVM=1
897 llvmonly_regtests = $(fullaot_regtests) gshared.exe
899 llvmonlycheck: mono $(llvmonly_regtests)
902 $(MAKE) fullaot-libs AOT_FLAGS="llvmonly,$(MONO_FULLAOT_ADDITIONAL_ARGS)$(INVARIANT_AOT_OPTIONS)"
903 cp $(llvmonly_regtests) $(fullaot_testing_deps) fullaot-tmp/
904 MONO_PATH=fullaot-tmp $(top_builddir)/runtime/mono-wrapper $(MOBILE_RUNTIME_ARG) --aot=llvmonly fullaot-tmp/{$(fullaot_testing_deps_commas),*.exe} || exit 1
905 ln -s $$PWD/mono fullaot-tmp/
906 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
909 MONO_GC_PARAMS=stack-mark=precise MONO_GC_DEBUG=clear-at-gc ./mono-sgen gc-test.exe
912 time env $(MINI_RUNTIME) --ncompile $(count) --compile Test:$(mtest) test.exe
915 time $(monodir)/mono/jit/mono --ncompile $(count) --compile Test:$(mtest) test.exe
917 stat1: mono bench.exe
918 $(MINI_RUNTIME) --verbose --statfile stats.pl --regression bench.exe
919 perl viewstat.pl stats.pl
921 stat2: mono basic.exe
922 $(MINI_RUNTIME) --verbose --statfile stats.pl --regression basic.exe
923 perl viewstat.pl -e stats.pl
925 stat3: mono bench.exe
926 $(MINI_RUNTIME) --statfile stats.pl --ncompile 1000 --compile Tests:test_0_many_nested_loops bench.exe
927 perl viewstat.pl stats.pl
932 # We need these because automake can't process normal make conditionals
933 check_local_targets = $(if $(EMIT_NUNIT), rcheck-nunit, rcheck)
935 check-local: $(check_local_targets)
938 rm -f mono a.out gmon.out *.o buildver-boehm.h buildver-sgen.h test.exe regressionexitcode.out TestResult-op_il_seq_point.xml*
940 pkgconfigdir = $(libdir)/pkgconfig
942 BUILT_SOURCES = version.h $(arch_built)
944 CLEANFILES= $(BUILT_SOURCES) *.exe *.dll
945 EXTRA_DIST = TestDriver.cs \
949 $(wasm_sources) cpu-wasm.md \
950 $(x86_sources) cpu-x86.md \
951 $(amd64_sources) cpu-amd64.md \
952 $(ppc_sources) cpu-ppc.md cpu-ppc64.md \
953 $(arm_sources) cpu-arm.md \
954 $(arm64_sources) cpu-arm64.md \
955 $(mips_sources) cpu-mips.md \
956 $(sparc_sources) cpu-sparc.md \
957 $(s390x_sources) cpu-s390x.md \
959 $(darwin_sources) Info.plist \
961 test_op_il_seq_point.sh \
962 test_op_il_seq_point_headerfooter.sh \
966 if test -e $(top_srcdir)/.git; then \
968 LANG=C; export LANG; \
969 if test -z "$$ghprbPullId"; then \
970 branch=`git branch | grep '^\*' | sed 's/.*detached .*/explicit/' | cut -d ' ' -f 2`; \
972 branch="pull-request-$$ghprbPullId"; \
974 version=`git log --no-color --first-parent -n1 --pretty=format:%h`; \
975 echo "#define FULL_VERSION \"$$branch/$$version\""; \
978 if test -z "$$MONO_BRANCH" -o -z "$$MONO_BUILD_REVISION"; then \
979 echo "#define FULL_VERSION \"tarball\""; \
981 echo "#define FULL_VERSION \"$$MONO_BRANCH/$$MONO_BUILD_REVISION\""; \
985 # Utility target for patching libtool to speed up linking
987 sed -e 's,if (for obj in $$oldobjs,if (for obj in "",g' < ../../libtool > 2; mv 2 ../../libtool
988 chmod a+x ../../libtool
990 # Utility target for patching libtool to get rid of the 'ranlib: file <file> has no symbols" warnings
992 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
993 chmod a+x ../../libtool
995 # Utility target to patch automake to generate the same format silent output as the old mono silent build did
997 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
1000 etags -o TAGS `find .. -name "*.h" -o -name "*.c"`
1003 llvm_makefile_dep = $(mono_build_root)/llvm/llvm_config.mk
1006 if HAS_EXTENSION_MODULE
1008 Makefile.am: Makefile.am.in
1009 echo "##################### Generated from Makefile.am.in, do not modify ##########################" > $@
1014 # Per-library because linking doesn't like -xc++, it treats libraries as C++.
1015 CFLAGS := $(filter-out @CXX_REMOVE_CFLAGS@, @CFLAGS@)