update readme (#21797)
[mono-project.git] / mono / mini / Makefile.am.in
blob3cf902f5c9e74cea1144c29d8ae73f4ebca15946
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.
5 CXXLD=$(MONO_CXXLD)
6 CCLD=$(MONO_CXXLD)
8 count=100000
9 mtest=for_loop
10 monodir=$(top_builddir)
11 mono=$(if $(MONO_EXECUTABLE),$(MONO_EXECUTABLE),mono)
13 if HOST_WIN32
14 PLATFORM_PATH_SEPARATOR=;
15 else
16 PLATFORM_PATH_SEPARATOR=:
17 endif
19 if !ENABLE_MSVC_ONLY
21 # This is needed for automake dependency generation
22 if SUPPORT_NULLGC
23 libgc_libs=
24 libgc_static_libs=
25 else
26 libgc_libs=$(monodir)/external/bdwgc/libgc.la
27 libgc_static_libs=$(monodir)/external/bdwgc/libgc-static.la
28 endif
30 glib_libs = $(monodir)/mono/eglib/libeglib.la
32 boehm_libs=     \
33         $(monodir)/mono/metadata/libmonoruntime.la      \
34         $(monodir)/mono/utils/libmonoutils.la \
35         $(glib_libs) \
36         $(libgc_libs)
38 sgen_libs = \
39         $(monodir)/mono/metadata/libmonoruntimesgen.la  \
40         $(monodir)/mono/sgen/libmonosgen.la     \
41         $(monodir)/mono/utils/libmonoutils.la \
42         $(glib_libs)
44 if ENABLE_LLVM
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
55 endif
57 endif # !ENABLE_MSVC_ONLY
59 if FULL_AOT_TESTS
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
62 # runtime info
63 MOBILE_RUNTIME_ARG=--runtime=mobile
64 else
65 MOBILE_RUNTIME_ARG=
66 endif
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
80 if !ENABLE_MSVC_ONLY
82 AM_CFLAGS = \
83         -I$(top_srcdir)         \
84         $(GLIB_CFLAGS)          \
85         $(LLVM_CFLAGS)          \
86         $(JEMALLOC_CFLAGS)      \
87         $(PLATFORM_CFLAGS) $(ARCH_CFLAGS) $(SHARED_CFLAGS)
89 AM_CXXFLAGS = -I$(top_srcdir) $(LLVM_CXXFLAGS) $(GLIB_CFLAGS)
91 if HOST_WIN32
92 export HOST_CC
93 # The mingw math.h has "extern inline" functions that dont appear in libs, so
94 # optimisation is required to actually inline them
95 PLATFORM_CFLAGS = -O
96 endif
98 monoldflags=$(export_ldflags)
99 monobinldflags=$(export_ldflags) $(extra_runtime_ldflags)
101 if HOST_WIN32
102 libmonoldflags=-no-undefined -avoid-version -Wl,--kill-at $(monoldflags)
103 else
104 if HOST_ANDROID
105 libmonoldflags= -avoid-version $(monoldflags)
106 else
107 libmonoldflags=$(monoldflags) -version-info 1:0:0
108 endif
109 endif
111 if SUPPORT_SGEN
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)
115 endif
117 if SUPPORT_BOEHM
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
121 endif
123 endif # !ENABLE_MSVC_ONLY
125 if SUPPORT_SGEN
126 mono_bin_suffix = sgen
127 libmono_suffix = sgen
128 else
129 mono_bin_suffix = boehm
130 libmono_suffix = boehm
131 endif
133 if DISABLE_EXECUTABLES
134 else
135 if !ENABLE_MSVC_ONLY
136 mono: mono-$(mono_bin_suffix)
137         ln -sf $< $@
139 mono.exe: mono-$(mono_bin_suffix).exe
140         ln -sf $< $@
141 else # !ENABLE_MSVC_ONLY
142 .PHONY: mono
143 mono:
144         make -C $(top_srcdir)/msvc mono
145         ln -sf $(mono_msvc_build_bin_dir)/mono-$(mono_bin_suffix)$(EXEEXT) ./mono.exe
146 if SUPPORT_SGEN
147         ln -sf $(mono_msvc_build_bin_dir)/mono-$(mono_bin_suffix)$(EXEEXT) ./mono-sgen.exe
148 endif
150 mono.exe: mono
152 monow.exe: mono
154 all-local: mono
156 clean-mono:
157         make -C $(top_srcdir)/msvc clean-mono
159 endif # !ENABLE_MSVC_ONLY
161 install-exec-hook:
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)
164 endif
166 if !ENABLE_MSVC_ONLY
168 if DISABLE_EXECUTABLES
169 else
170 if HOST_WIN32
171 bin_PROGRAMS = $(boehm_binaries) $(sgen_binaries) monow
172 else
173 bin_PROGRAMS = $(boehm_binaries) $(sgen_binaries)
174 endif
175 endif
177 if DISABLE_EXECUTABLES
178 noinst_PROGRAMS =
179 else
180 noinst_PROGRAMS = mono
181 endif
183 if DISABLE_EXECUTABLES
184 shared_libraries = $(boehm_libraries) $(sgen_libraries)
185 else
186 if SHARED_MONO
187 shared_libraries = $(boehm_libraries) $(sgen_libraries)
188 endif
189 endif
191 lib_LTLIBRARIES = $(shared_libraries)
193 if DISABLE_INTERPRETER
194 lib_LTLIBRARIES += $(interp_libs)
195 endif
197 if SHARED_MONO
198 mini_common_lib = libmini.la
199 else
200 mini_common_lib = 
201 endif
203 noinst_LTLIBRARIES = $(mini_common_lib)
205 noinst_LIBRARIES = libmain.a
207 libmain_a_SOURCES = main-sgen.c
208 if SUPPORT_BOEHM
209 libmain_a_SOURCES += main.c
210 endif
211 libmain_a_CFLAGS = $(AM_CFLAGS) @CXX_ADD_CFLAGS@
213 # we need this to prevent automake from generating a default mono_SOURCES = mono.c
214 mono_SOURCES =
216 mono_boehm_SOURCES =
217 mono_boehm_CFLAGS = $(AM_CFLAGS) @CXX_REMOVE_CFLAGS@
219 AM_CPPFLAGS = $(LIBGC_CPPFLAGS)
221 mono_sgen_SOURCES =
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
227 # link was done
228 if SUPPORT_BOEHM
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
232 endif
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
239 if DTRACE_G_REQUIRED
240 LIBMONO_DTRACE_OBJECT = .libs/mono-dtrace.$(OBJEXT)
241 if STATIC_MONO
242 MONO_DTRACE_OBJECT = mono-dtrace.$(OBJEXT)
243 else
244 MONO_DTRACE_OBJECT = 
245 endif
246 else
247 MONO_DTRACE_OBJECT = 
248 LIBMONO_DTRACE_OBJECT = 
249 endif
251 if STATIC_MONO
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)
256 else 
257 MONO_LIB=libmonoboehm-2.0.la
258 MONO_SGEN_LIB=libmonosgen-2.0.la
259 endif
261 LLVMMONOF=$(LLVM_LIBS) $(LLVM_LDFLAGS)
263 mono_boehm_LDADD = \
264         libmain_a-main.$(OBJEXT) \
265         $(MONO_LIB)             \
266         $(glib_libs)            \
267         $(LLVMMONOF)            \
268         $(LIBICONV)             \
269         $(Z_LIBS)               \
270         -lm                     \
271         $(MONO_DTRACE_OBJECT)
273 mono_boehm_LDFLAGS = \
274         $(static_flags) $(monobinldflags) $(monobin_platform_ldflags) 
276 mono_sgen_LDADD = \
277         libmain_a-main-sgen.$(OBJEXT) \
278         $(MONO_SGEN_LIB)        \
279         $(glib_libs)            \
280         $(LLVMMONOF)            \
281         $(LIBICONV)             \
282         $(Z_LIBS)               \
283         -lm                     \
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
291 endif
293 if BITCODE
294 libmonoldflags += -no-undefined
295 endif
297 # if SUPPORT_SGEN
299 # mono_LDADD = $(mono_sgen_LDADD)
300 # mono_LDFLAGS = $(mono_sgen_LDFLAGS)
302 # endif
305 if DTRACE_G_REQUIRED
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
315 endif
317 # Create monow.exe, linked for the 'windows' subsystem
318 if HOST_WIN32
319 if SUPPORT_BOEHM
320 monow_LDADD = $(mono_boehm_LDADD)
321 monow_LDFLAGS = $(mono_boehm_LDFLAGS) -mwindows
322 monow_SOURCES = $(mono_boehm_SOURCES)
323 else
324 monow_LDADD = $(mono_sgen_LDADD)
325 monow_LDFLAGS = $(mono_sgen_LDFLAGS) -mwindows
326 monow_SOURCES = $(mono_sgen_SOURCES)
327 endif
328 endif
330 wasm_sources = \
331         mini-wasm.c             \
332         mini-wasm.h             \
333         mini-wasm-debugger.c    \
334         debugger-engine.c       \
335         exceptions-wasm.c       \
336         tramp-wasm.c
338 x86_sources = \
339         mini-x86.c              \
340         mini-x86.h              \
341         exceptions-x86.c        \
342         tramp-x86.c     \
343         mini-x86-gsharedvt.c    \
344         tramp-x86-gsharedvt.c
346 amd64_sources = \
347         mini-amd64.c            \
348         mini-amd64.h            \
349         exceptions-amd64.c      \
350         tramp-amd64.c   \
351         mini-amd64-gsharedvt.c  \
352         mini-amd64-gsharedvt.h  \
353         tramp-amd64-gsharedvt.c
355 loongarch64_sources = \
356         mini-loongarch64.c              \
357         mini-loongarch64.h              \
358         exceptions-loongarch64.c        \
359         tramp-loongarch64.c             \
360         mini-loongarch64-gsharedvt.c    \
361         mini-loongarch64-gsharedvt.h    \
362         tramp-loongarch64-gsharedvt.c
364 ppc_sources = \
365         mini-ppc.c              \
366         mini-ppc.h              \
367         exceptions-ppc.c        \
368         tramp-ppc.c
370 arm_sources = \
371         mini-arm.c              \
372         mini-arm.h              \
373         exceptions-arm.c        \
374         tramp-arm.c     \
375         mini-arm-gsharedvt.c    \
376         tramp-arm-gsharedvt.c
378 arm64_sources = \
379         mini-arm64.c            \
380         mini-arm64.h            \
381         exceptions-arm64.c      \
382         tramp-arm64.c   \
383         mini-arm64-gsharedvt.c  \
384         mini-arm64-gsharedvt.h  \
385         tramp-arm64-gsharedvt.c
387 mips_sources = \
388         mini-mips.c             \
389         mini-mips.h             \
390         exceptions-mips.c       \
391         tramp-mips.c
393 sparc_sources = \
394         mini-sparc.c            \
395         mini-sparc.h            \
396         exceptions-sparc.c      \
397         tramp-sparc.c
399 s390x_sources = \
400         mini-s390x.c            \
401         mini-s390x.h            \
402         exceptions-s390x.c      \
403         tramp-s390x.c
405 riscv_sources = \
406         mini-riscv.c \
407         mini-riscv.h \
408         exceptions-riscv.c \
409         tramp-riscv.c
411 darwin_sources = \
412         mini-darwin.c
414 windows_sources = \
415         mini-windows.c \
416         mini-windows-tls-callback.c \
417         mini-windows.h \
418         mini-windows-dllmain.c \
419         mini-windows-dlldac.c
421 posix_sources = \
422         mini-posix.c
424 if ENABLE_LLVM
425 llvm_sources = \
426         mini-llvm.c             \
427         mini-llvm-cpp.cpp \
428         llvm-jit.cpp
429 endif
431 interp_sources =        \
432         interp/interp.h \
433         interp/interp-internals.h       \
434         interp/interp.c \
435         interp/interp-intrins.h \
436         interp/interp-intrins.c \
437         interp/mintops.h        \
438         interp/mintops.def      \
439         interp/mintops.c        \
440         interp/transform.h      \
441         interp/transform.c
443 interp_libs = libmono-ee-interp.la
445 if !DISABLE_INTERPRETER
446 interp_libs_with_mini = $(interp_libs)
447 endif
449 if ENABLE_LLVM
450 llvm_runtime_sources = \
451         llvm-runtime.cpp
452 else
453 if ENABLE_LLVM_RUNTIME
454 llvm_runtime_sources = \
455         llvm-runtime.cpp
456 endif
457 endif
459 common_sources = \
460         mini.c                  \
461         mini-runtime.c  \
462         seq-points.c    \
463         seq-points.h    \
464         ir-emit.h               \
465         method-to-ir.c          \
466         cfgdump.h               \
467         cfgdump.c               \
468         decompose.c             \
469         mini.h                  \
470         version.h               \
471         optflags-def.h          \
472         jit-icalls.h            \
473         jit-icalls.c            \
474         trace.c                 \
475         trace.h                 \
476         patch-info.h            \
477         mini-ops.h              \
478         mini-arch.h             \
479         dominators.c            \
480         cfold.c                 \
481         regalloc.h              \
482         helpers.c               \
483         liveness.c              \
484         ssa.c                   \
485         abcremoval.c            \
486         abcremoval.h            \
487         local-propagation.c     \
488         driver.c                \
489         debug-mini.c            \
490         linear-scan.c           \
491         aot-compiler.h          \
492         aot-compiler.c          \
493         aot-runtime.c           \
494         aot-runtime-wasm.c      \
495         wasm_m2n_invoke.g.h     \
496         graph.c                 \
497         mini-codegen.c          \
498         mini-exceptions.c       \
499         mini-trampolines.c      \
500         branch-opts.c           \
501         mini-generic-sharing.c  \
502         simd-methods.h          \
503         tasklets.c              \
504         tasklets.h              \
505         simd-intrinsics.c       \
506         mini-native-types.c \
507         mini-unwind.h           \
508         unwind.c                \
509         image-writer.h          \
510         image-writer.c          \
511         dwarfwriter.h           \
512         dwarfwriter.c           \
513         mini-gc.h               \
514         mini-gc.c               \
515         debugger-agent.h        \
516         debugger-engine.h       \
517         debugger-agent-stubs.c  \
518         debugger-state-machine.h        \
519         xdebug.c                        \
520         mini-llvm.h                     \
521         mini-llvm-cpp.h \
522         llvm-jit.h              \
523         alias-analysis.c        \
524         mini-cross-helpers.c \
525         arch-stubs.c            \
526         llvm-runtime.h  \
527         llvm-intrinsics.h       \
528         type-checking.c \
529         calls.c                 \
530         lldb.h                  \
531         lldb.c  \
532         memory-access.c \
533         intrinsics.c \
534         mini-profiler.c \
535         interp-stubs.c \
536         llvmonly-runtime.h \
537         llvmonly-runtime.c \
538         aot-runtime.h   \
539         ee.h \
540         tiered.h \
541         tiered.c \
542         mini-runtime.h \
543         monovm.h \
544         monovm.c
546 endif # !ENABLE_MSVC_ONLY
548 # keep in sync with mcs/class/Mono.Runtime.Tests
549 test_sources =                  \
550         basic-calls.cs          \
551         basic-long.cs           \
552         bench.cs                \
553         builtin-types.cs        \
554         objects.cs              \
555         arrays.cs               \
556         basic-float.cs          \
557         basic-math.cs           \
558         basic.cs                \
559         exceptions.cs           \
560         devirtualization.cs     \
561         iltests.il              \
562         test.cs                 \
563         generics.cs             \
564         generics-variant-types.il\
565         basic-simd.cs \
566         basic-vectors.cs \
567         aot-tests.cs \
568         gc-test.cs \
569         gshared.cs \
570         unaligned.cs    \
571         MemoryIntrinsics.il     \
572         mixed.cs        \
573         ratests.cs
575 regtests_UNIVERSAL = \
576         aot-tests.exe \
577         basic.exe \
578         basic-float.exe \
579         basic-long.exe \
580         basic-calls.exe \
581         builtin-types.exe \
582         gshared.exe \
583         objects.exe \
584         arrays.exe \
585         basic-math.exe \
586         exceptions.exe \
587         iltests.exe \
588         devirtualization.exe \
589         generics.exe \
590         basic-simd.exe \
591         unaligned.exe   \
592         basic-vectors.exe       \
593         ratests.exe
595 regtests_DISABLED = 
597 if FULL_AOT_TESTS
598 regtests_DISABLED += builtin-types.exe
599 endif
601 regtests = $(filter-out $(regtests_DISABLED),$(regtests_UNIVERSAL))
603 if !ENABLE_MSVC_ONLY
605 if WASM
606 arch_sources = $(wasm_sources)
607 arch_built=cpu-wasm.h
608 arch_define=__wasm__
609 target_define=TARGET_WASM
610 endif
612 if X86
613 arch_sources = $(x86_sources)
614 arch_built=cpu-x86.h
615 arch_define=__i386__
616 target_define=TARGET_X86
617 endif
619 if AMD64
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=
625 endif
627 if LOONGARCH64
628 arch_sources = $(loongarch64_sources)
629 arch_built=cpu-loongarch64.h
630 arch_define=__loongarch64
631 target_define=TARGET_LOONGARCH64
632 endif
634 if POWERPC
635 arch_sources = $(ppc_sources)
636 arch_built=cpu-ppc.h
637 arch_define=__ppc__
638 target_define=TARGET_POWERPC
639 endif
641 if POWERPC64
642 arch_sources = $(ppc_sources)
643 arch_built=cpu-ppc64.h
644 arch_define=__ppc64__
645 target_define=TARGET_POWERPC
646 endif
648 if MIPS
649 arch_sources = $(mips_sources)
650 arch_built=cpu-mips.h
651 arch_define=__mips__
652 target_define=TARGET_MIPS
653 endif
655 if ARM
656 # pick up arm_dpimacros.h
657 ARCH_CFLAGS = -I../arch/arm
658 arch_sources = $(arm_sources)
659 arch_built=cpu-arm.h
660 arch_define=__arm__
661 target_define=TARGET_ARM
662 endif
664 if ARM64
665 arch_sources = $(arm64_sources)
666 arch_built=cpu-arm64.h
667 arch_define=__aarch64__
668 target_define=TARGET_ARM64
669 endif
671 if SPARC
672 arch_sources = $(sparc_sources)
673 arch_built=cpu-sparc.h
674 arch_define=__sparc__
675 target_define=TARGET_SPARC
676 endif
678 if SPARC64
679 arch_sources = $(sparc_sources)
680 arch_built=cpu-sparc.h
681 arch_define=__sparc__
682 target_define=TARGET_SPARC
683 endif
685 if S390X
686 arch_sources = $(s390x_sources)
687 arch_built=cpu-s390x.h
688 arch_define=__s390__
689 target_define=TARGET_S390X
690 endif
692 if RISCV32
693 arch_sources = $(riscv_sources)
694 arch_built = cpu-riscv32.h
695 arch_define = __riscv
696 target_define = TARGET_RISCV32
697 endif
699 if RISCV64
700 arch_sources = $(riscv_sources)
701 arch_built = cpu-riscv64.h
702 arch_define = __riscv
703 target_define = TARGET_RISCV64
704 endif
706 if HOST_WIN32
707 os_sources = $(windows_sources)
708 monobin_platform_ldflags=
709 endif
711 if HOST_SIGPOSIX
712 os_sources = $(posix_sources)
713 monobin_platform_ldflags=
714 endif
716 if HOST_DARWIN
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
720 endif
722 if MONO_JEMALLOC_ENABLED
723 libmonoldflags += $(JEMALLOC_LDFLAGS)
724 endif
726 libmono_ee_interp_la_SOURCES = $(interp_sources)
727 libmono_ee_interp_la_CFLAGS = $(AM_CFLAGS) @CXX_ADD_CFLAGS@ $(INTERP_CFLAGS)
728 if BITCODE
729 libmono_ee_interp_la_LDFLAGS = $(libmonoldflags)
730 if DISABLE_INTERPRETER
731 libmono_ee_interp_la_LIBADD = libmonosgen-2.0.la
732 endif
733 endif
735 if !WASM
736 extra_libmono_dbg_source = debugger-engine.c
737 endif
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@
741 if BITCODE
742 if DISABLE_DEBUGGER_AGENT
743 libmono_dbg_la_LIBADD = libmonosgen-2.0.la
744 endif
745 endif
747 dbg_libs = libmono-dbg.la
749 if DISABLE_DEBUGGER_AGENT
750 lib_LTLIBRARIES += $(dbg_libs)
751 endif
753 if !DISABLE_DEBUGGER_AGENT
754 dbg_libs_with_mini = $(dbg_libs)
755 noinst_LTLIBRARIES += $(dbg_libs)
756 endif
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 = \
800         jit.h           \
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=$@ $<
838 GENMDESC_OPTS=
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
881 testi: mono test.exe
882         $(MINI_RUNTIME) -v -v --ncompile 1 --compile Test:$(mtest) test.exe
884 test-local: $(regtests)
886 test-bundle-local:
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
891 if SUPPORT_BOEHM
892         cp -L mono-boehm $(TEST_BUNDLE_PATH)/
893         chmod +x $(TEST_BUNDLE_PATH)/mono-boehm
894 endif
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>\
909                         </test-suite>\
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
924 check-seq-points:
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
951 llvmaotcheck:
952         $(MAKE) aotcheck LLVM=1
954 gsharedvtcheck:
955         $(MAKE) fullaotcheck GSHAREDVT=1
957 hybridcheck:
958         $(MAKE) fullaotcheck HYBRID=1
960 # FIXME: force preemptive suspend while interpreter doesn't support coop/hybird suspend
961 fullaotmixedcheck:
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 = \
969         mscorlib.dll \
970         System.Core.dll \
971         System.dll \
972         System.Xml.dll \
973         System.Security.dll \
974         Mono.Simd.dll \
975         Mono.Security.dll \
976         System.Numerics.dll \
977         System.Numerics.Vectors.dll \
978         Mono.Posix.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
985 # on mobile profiles
986 if FULL_AOT_TESTS
987 FULLAOT_LIBS_DISABLED += \
988         Mono.Posix.dll \
989         System.Configuration.dll
990 else
991 if FULL_AOT_INTERP_TESTS
992 FULLAOT_LIBS_DISABLED += \
993         Mono.Posix.dll \
994         System.Configuration.dll
995 endif
996 endif
998 FULLAOT_LIBS = $(filter-out $(FULLAOT_LIBS_DISABLED),$(FULLAOT_LIBS_UNIVERSAL))
1000 FULLAOT_TMP_DIR=$(top_builddir)/mono/mini/fullaot-tmp
1001 if FULL_AOT_TESTS
1002 # use the available testing profile
1003 FULLAOT_MONO_PATH=$(CLASS)
1004 else
1005 FULLAOT_MONO_PATH=$(FULLAOT_TMP_DIR)
1006 endif
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)
1015 if !FULL_AOT_TESTS
1016         $(MAKE) fullaot-libs AOT_FLAGS="$(FULLAOT_AOT_ARGS)"
1017 endif
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
1033 llvmfullaotcheck:
1034         $(MAKE) fullaotcheck LLVM=1 GSHAREDVT=1
1036 llvmonly_regtests = $(fullaot_regtests) gshared.exe
1038 llvmonlycheck: mono $(llvmonly_regtests)
1039         rm -rf fullaot-tmp
1040         mkdir fullaot-tmp
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
1053 mbench: 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
1068 docu: mini.sgm
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)
1076 clean-local:
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 \
1085         TestHelpers.cs \
1086         genmdesc.py                             \
1087         $(test_sources)                         \
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            \
1101         $(posix_sources)                                        \
1102         test_op_il_seq_point.sh                 \
1103         test_op_il_seq_point_headerfooter.sh    \
1104         interp/whitebox-snippets.il             \
1105         Makefile.am.in
1107 version.h: Makefile
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`; \
1113                         else \
1114                                 branch="pull-request-$$ghprbPullId"; \
1115                         fi; \
1116                         version=`git log --no-color --first-parent -n1 --pretty=format:%h`; \
1117                         echo "#define FULL_VERSION \"$$branch/$$version\""; \
1118                 ); \
1119         else \
1120                 if test -z "$$MONO_BRANCH" -o -z "$$MONO_BUILD_REVISION"; then \
1121                         echo "#define FULL_VERSION \"tarball\""; \
1122                 else \
1123                         echo "#define FULL_VERSION \"$$MONO_BRANCH/$$MONO_BUILD_REVISION\""; \
1124                 fi \
1125         fi > version.h
1127 # Utility target for patching libtool to speed up linking
1128 patch-libtool:
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
1133 patch-osx-libtool:
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
1138 patch-automake:
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
1141 tags:
1142         etags -o TAGS `find .. -name "*.h" -o -name "*.c"`
1144 if ENABLE_LLVM
1145 llvm_makefile_dep = $(mono_build_root)/llvm/llvm_config.mk
1146 endif
1148 if HAS_EXTENSION_MODULE
1149 else
1150 Makefile.am: Makefile.am.in
1151         echo "##################### Generated from Makefile.am.in, do not modify ##########################" > $@
1152         cat $< >> $@
1154 endif
1156 # Per-library because linking doesn't like -xc++, it treats libraries as C++.
1157 CFLAGS := $(filter-out @CXX_REMOVE_CFLAGS@, @CFLAGS@)