[tests] Reenable enum equals test on interpreter (#18673)
[mono-project.git] / mono / mini / Makefile.am.in
blobc193c9c683bbd37a58a180a6c8a7fced8b6a7334
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 if LOADED_LLVM
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@
219 if HOST_DARWIN
220 libmono_llvm_la_LDFLAGS=-Wl,-undefined -Wl,suppress -Wl,-flat_namespace 
221 endif
222 endif
224 # we need this to prevent automake from generating a default mono_SOURCES = mono.c
225 mono_SOURCES =
227 mono_boehm_SOURCES =
228 mono_boehm_CFLAGS = $(AM_CFLAGS) @CXX_REMOVE_CFLAGS@
230 AM_CPPFLAGS = $(LIBGC_CPPFLAGS)
232 mono_sgen_SOURCES =
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
236 # link was done
237 if SUPPORT_BOEHM
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
241 endif
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
248 if DTRACE_G_REQUIRED
249 LIBMONO_DTRACE_OBJECT = .libs/mono-dtrace.$(OBJEXT)
250 if STATIC_MONO
251 MONO_DTRACE_OBJECT = mono-dtrace.$(OBJEXT)
252 else
253 MONO_DTRACE_OBJECT = 
254 endif
255 else
256 MONO_DTRACE_OBJECT = 
257 LIBMONO_DTRACE_OBJECT = 
258 endif
260 if STATIC_MONO
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)
265 else 
266 MONO_LIB=libmonoboehm-2.0.la
267 MONO_SGEN_LIB=libmonosgen-2.0.la
268 endif
270 if LOADED_LLVM
271 LLVMMONOF=
272 else
273 LLVMMONOF=$(LLVM_LIBS) $(LLVM_LDFLAGS)
274 endif
276 mono_boehm_LDADD = \
277         libmain_a-main.$(OBJEXT) \
278         $(MONO_LIB)             \
279         $(glib_libs)            \
280         $(LLVMMONOF)            \
281         $(LIBICONV)             \
282         $(Z_LIBS)               \
283         -lm                     \
284         $(MONO_DTRACE_OBJECT)
286 mono_boehm_LDFLAGS = \
287         $(static_flags) $(monobinldflags) $(monobin_platform_ldflags) 
289 mono_sgen_LDADD = \
290         libmain_a-main-sgen.$(OBJEXT) \
291         $(MONO_SGEN_LIB)        \
292         $(glib_libs)            \
293         $(LLVMMONOF)            \
294         $(LIBICONV)             \
295         $(Z_LIBS)               \
296         -lm                     \
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
304 endif
306 if BITCODE
307 libmonoldflags += -no-undefined
308 endif
310 # if SUPPORT_SGEN
312 # mono_LDADD = $(mono_sgen_LDADD)
313 # mono_LDFLAGS = $(mono_sgen_LDFLAGS)
315 # endif
318 if DTRACE_G_REQUIRED
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
328 endif
330 # Create monow.exe, linked for the 'windows' subsystem
331 if HOST_WIN32
332 if SUPPORT_BOEHM
333 monow_LDADD = $(mono_boehm_LDADD)
334 monow_LDFLAGS = $(mono_boehm_LDFLAGS) -mwindows
335 monow_SOURCES = $(mono_boehm_SOURCES)
336 else
337 monow_LDADD = $(mono_sgen_LDADD)
338 monow_LDFLAGS = $(mono_sgen_LDFLAGS) -mwindows
339 monow_SOURCES = $(mono_sgen_SOURCES)
340 endif
341 endif
343 wasm_sources = \
344         mini-wasm.c             \
345         mini-wasm.h             \
346         mini-wasm-debugger.c    \
347         debugger-engine.c       \
348         exceptions-wasm.c       \
349         tramp-wasm.c
351 x86_sources = \
352         mini-x86.c              \
353         mini-x86.h              \
354         exceptions-x86.c        \
355         tramp-x86.c     \
356         mini-x86-gsharedvt.c    \
357         tramp-x86-gsharedvt.c
359 amd64_sources = \
360         mini-amd64.c            \
361         mini-amd64.h            \
362         exceptions-amd64.c      \
363         tramp-amd64.c   \
364         mini-amd64-gsharedvt.c  \
365         mini-amd64-gsharedvt.h  \
366         tramp-amd64-gsharedvt.c
368 ppc_sources = \
369         mini-ppc.c              \
370         mini-ppc.h              \
371         exceptions-ppc.c        \
372         tramp-ppc.c
374 arm_sources = \
375         mini-arm.c              \
376         mini-arm.h              \
377         exceptions-arm.c        \
378         tramp-arm.c     \
379         mini-arm-gsharedvt.c    \
380         tramp-arm-gsharedvt.c
382 arm64_sources = \
383         mini-arm64.c            \
384         mini-arm64.h            \
385         exceptions-arm64.c      \
386         tramp-arm64.c   \
387         mini-arm64-gsharedvt.c  \
388         mini-arm64-gsharedvt.h  \
389         tramp-arm64-gsharedvt.c
391 mips_sources = \
392         mini-mips.c             \
393         mini-mips.h             \
394         exceptions-mips.c       \
395         tramp-mips.c
397 sparc_sources = \
398         mini-sparc.c            \
399         mini-sparc.h            \
400         exceptions-sparc.c      \
401         tramp-sparc.c
403 s390x_sources = \
404         mini-s390x.c            \
405         mini-s390x.h            \
406         support-s390x.h         \
407         exceptions-s390x.c      \
408         tramp-s390x.c
410 riscv_sources = \
411         mini-riscv.c \
412         mini-riscv.h \
413         exceptions-riscv.c \
414         tramp-riscv.c
416 darwin_sources = \
417         mini-darwin.c
419 windows_sources = \
420         mini-windows.c \
421         mini-windows-tls-callback.c \
422         mini-windows.h \
423         mini-windows-dllmain.c \
424         mini-windows-dlldac.c
426 posix_sources = \
427         mini-posix.c
429 if ENABLE_LLVM
430 if LOADED_LLVM
431 llvm_sources = \
432         mini-llvm-loaded.c
433 else
434 llvm_sources = \
435         mini-llvm.c             \
436         mini-llvm-loaded.c \
437         mini-llvm-cpp.cpp \
438         llvm-jit.cpp
439 endif
440 endif
442 interp_sources =        \
443         interp/interp.h \
444         interp/interp-internals.h       \
445         interp/interp.c \
446         interp/mintops.h        \
447         interp/mintops.def      \
448         interp/mintops.c        \
449         interp/transform.h      \
450         interp/transform.c
452 interp_libs = libmono-ee-interp.la
454 if !DISABLE_INTERPRETER
455 interp_libs_with_mini = $(interp_libs)
456 endif
458 if ENABLE_LLVM
459 llvm_runtime_sources = \
460         llvm-runtime.cpp
461 else
462 if ENABLE_LLVM_RUNTIME
463 llvm_runtime_sources = \
464         llvm-runtime.cpp
465 endif
466 endif
468 if ENABLE_NETCORE
469 netcore_sources = \
470         main-core.c
471 endif
473 common_sources = \
474         mini.c                  \
475         mini-runtime.c  \
476         seq-points.c    \
477         seq-points.h    \
478         ir-emit.h               \
479         method-to-ir.c          \
480         cfgdump.h               \
481         cfgdump.c               \
482         decompose.c             \
483         mini.h                  \
484         version.h               \
485         optflags-def.h          \
486         jit-icalls.h            \
487         jit-icalls.c            \
488         trace.c                 \
489         trace.h                 \
490         patch-info.h            \
491         mini-ops.h              \
492         mini-arch.h             \
493         dominators.c            \
494         cfold.c                 \
495         regalloc.h              \
496         helpers.c               \
497         liveness.c              \
498         ssa.c                   \
499         abcremoval.c            \
500         abcremoval.h            \
501         local-propagation.c     \
502         driver.c                \
503         debug-mini.c            \
504         linear-scan.c           \
505         aot-compiler.h          \
506         aot-compiler.c          \
507         aot-runtime.c           \
508         aot-runtime-wasm.c      \
509         wasm_m2n_invoke.g.h     \
510         graph.c                 \
511         mini-codegen.c          \
512         mini-exceptions.c       \
513         mini-trampolines.c      \
514         branch-opts.c           \
515         mini-generic-sharing.c  \
516         simd-methods.h          \
517         simd-methods-netcore.h  \
518         tasklets.c              \
519         tasklets.h              \
520         simd-intrinsics.c       \
521         simd-intrinsics-netcore.c       \
522         mini-native-types.c \
523         mini-unwind.h           \
524         unwind.c                \
525         image-writer.h          \
526         image-writer.c          \
527         dwarfwriter.h           \
528         dwarfwriter.c           \
529         mini-gc.h               \
530         mini-gc.c               \
531         debugger-agent.h        \
532         debugger-engine.h       \
533         debugger-agent-stubs.c  \
534         debugger-state-machine.h        \
535         xdebug.c                        \
536         mini-llvm.h                     \
537         mini-llvm-cpp.h \
538         llvm-jit.h              \
539         alias-analysis.c        \
540         mini-cross-helpers.c \
541         arch-stubs.c            \
542         llvm-runtime.h  \
543         type-checking.c \
544         calls.c                 \
545         lldb.h                  \
546         lldb.c  \
547         memory-access.c \
548         intrinsics.c \
549         mini-profiler.c \
550         interp-stubs.c \
551         llvmonly-runtime.h \
552         llvmonly-runtime.c \
553         aot-runtime.h   \
554         ee.h \
555         tiered.h \
556         tiered.c \
557         mini-runtime.h
559 endif # !ENABLE_MSVC_ONLY
561 # keep in sync with mcs/class/Mono.Runtime.Tests
562 test_sources =                  \
563         basic-calls.cs          \
564         basic-long.cs           \
565         bench.cs                \
566         builtin-types.cs        \
567         objects.cs              \
568         arrays.cs               \
569         basic-float.cs          \
570         basic-math.cs           \
571         basic.cs                \
572         exceptions.cs           \
573         devirtualization.cs     \
574         iltests.il              \
575         test.cs                 \
576         generics.cs             \
577         generics-variant-types.il\
578         basic-simd.cs \
579         basic-vectors.cs \
580         aot-tests.cs \
581         gc-test.cs \
582         gshared.cs \
583         unaligned.cs    \
584         MemoryIntrinsics.il     \
585         mixed.cs        \
586         ratests.cs
588 regtests_UNIVERSAL = \
589         aot-tests.exe \
590         basic.exe \
591         basic-float.exe \
592         basic-long.exe \
593         basic-calls.exe \
594         builtin-types.exe \
595         gshared.exe \
596         objects.exe \
597         arrays.exe \
598         basic-math.exe \
599         exceptions.exe \
600         iltests.exe \
601         devirtualization.exe \
602         generics.exe \
603         basic-simd.exe \
604         unaligned.exe   \
605         basic-vectors.exe       \
606         ratests.exe
608 regtests_DISABLED = 
610 if FULL_AOT_TESTS
611 regtests_DISABLED += builtin-types.exe
612 endif
614 regtests = $(filter-out $(regtests_DISABLED),$(regtests_UNIVERSAL))
616 if !ENABLE_MSVC_ONLY
618 if WASM
619 arch_sources = $(wasm_sources)
620 arch_built=cpu-wasm.h
621 arch_define=__wasm__
622 target_define=TARGET_WASM
623 endif
625 if X86
626 arch_sources = $(x86_sources)
627 arch_built=cpu-x86.h
628 arch_define=__i386__
629 target_define=TARGET_X86
630 endif
632 if AMD64
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=
638 endif
640 if POWERPC
641 arch_sources = $(ppc_sources)
642 arch_built=cpu-ppc.h
643 arch_define=__ppc__
644 target_define=TARGET_POWERPC
645 endif
647 if POWERPC64
648 arch_sources = $(ppc_sources)
649 arch_built=cpu-ppc64.h
650 arch_define=__ppc64__
651 target_define=TARGET_POWERPC
652 endif
654 if MIPS
655 arch_sources = $(mips_sources)
656 arch_built=cpu-mips.h
657 arch_define=__mips__
658 target_define=TARGET_MIPS
659 endif
661 if ARM
662 # pick up arm_dpimacros.h
663 ARCH_CFLAGS = -I../arch/arm
664 arch_sources = $(arm_sources)
665 arch_built=cpu-arm.h
666 arch_define=__arm__
667 target_define=TARGET_ARM
668 endif
670 if ARM64
671 arch_sources = $(arm64_sources)
672 arch_built=cpu-arm64.h
673 arch_define=__aarch64__
674 target_define=TARGET_ARM64
675 endif
677 if SPARC
678 arch_sources = $(sparc_sources)
679 arch_built=cpu-sparc.h
680 arch_define=__sparc__
681 target_define=TARGET_SPARC
682 endif
684 if SPARC64
685 arch_sources = $(sparc_sources)
686 arch_built=cpu-sparc.h
687 arch_define=__sparc__
688 target_define=TARGET_SPARC
689 endif
691 if S390X
692 arch_sources = $(s390x_sources)
693 arch_built=cpu-s390x.h
694 arch_define=__s390__
695 target_define=TARGET_S390X
696 endif
698 if RISCV32
699 arch_sources = $(riscv_sources)
700 arch_built = cpu-riscv32.h
701 arch_define = __riscv
702 target_define = TARGET_RISCV32
703 endif
705 if RISCV64
706 arch_sources = $(riscv_sources)
707 arch_built = cpu-riscv64.h
708 arch_define = __riscv
709 target_define = TARGET_RISCV64
710 endif
712 if HOST_WIN32
713 os_sources = $(windows_sources)
714 monobin_platform_ldflags=
715 endif
717 if HOST_SIGPOSIX
718 os_sources = $(posix_sources)
719 monobin_platform_ldflags=
720 endif
722 if HOST_DARWIN
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
726 endif
728 if MONO_JEMALLOC_ENABLED
729 libmonoldflags += $(JEMALLOC_LDFLAGS)
730 endif
732 libmono_ee_interp_la_SOURCES = $(interp_sources)
733 libmono_ee_interp_la_CFLAGS = $(AM_CFLAGS) @CXX_ADD_CFLAGS@ $(INTERP_CFLAGS)
734 if BITCODE
735 libmono_ee_interp_la_LDFLAGS = $(libmonoldflags)
736 if DISABLE_INTERPRETER
737 libmono_ee_interp_la_LIBADD = libmonosgen-2.0.la
738 endif
739 endif
741 if !WASM
742 extra_libmono_dbg_source = debugger-engine.c
743 endif
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@
747 if BITCODE
748 if DISABLE_DEBUGGER_AGENT
749 libmono_dbg_la_LIBADD = libmonosgen-2.0.la
750 endif
751 endif
753 dbg_libs = libmono-dbg.la
755 if DISABLE_DEBUGGER_AGENT
756 lib_LTLIBRARIES += $(dbg_libs)
757 endif
759 if !DISABLE_DEBUGGER_AGENT
760 dbg_libs_with_mini = $(dbg_libs)
761 noinst_LTLIBRARIES += $(dbg_libs)
762 endif
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
829 %.exe: %.il
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=$@ $<
841 GENMDESC_OPTS=
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
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 if AMD64
943 LLVM_AOT_COMPILER_OPTS=$(if $(LLVM),llvmllc=-mattr=+sse3,)
944 else
945 LLVM_AOT_COMPILER_OPTS=
946 endif
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
955 llvmaotcheck:
956         $(MAKE) aotcheck LLVM=1
958 gsharedvtcheck:
959         $(MAKE) fullaotcheck GSHAREDVT=1
961 hybridcheck:
962         $(MAKE) fullaotcheck HYBRID=1
964 # FIXME: force preemptive suspend while interpreter doesn't support coop/hybird suspend
965 fullaotmixedcheck:
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 = \
973         mscorlib.dll \
974         System.Core.dll \
975         System.dll \
976         System.Xml.dll \
977         System.Security.dll \
978         Mono.Simd.dll \
979         Mono.Security.dll \
980         System.Numerics.dll \
981         System.Numerics.Vectors.dll \
982         Mono.Posix.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
989 # on mobile profiles
990 if FULL_AOT_TESTS
991 FULLAOT_LIBS_DISABLED += \
992         Mono.Posix.dll \
993         System.Configuration.dll
994 else
995 if FULL_AOT_INTERP_TESTS
996 FULLAOT_LIBS_DISABLED += \
997         Mono.Posix.dll \
998         System.Configuration.dll
999 endif
1000 endif
1002 FULLAOT_LIBS = $(filter-out $(FULLAOT_LIBS_DISABLED),$(FULLAOT_LIBS_UNIVERSAL))
1004 FULLAOT_TMP_DIR=$(top_builddir)/mono/mini/fullaot-tmp
1005 if FULL_AOT_TESTS
1006 # use the available testing profile
1007 FULLAOT_MONO_PATH=$(CLASS)
1008 else
1009 FULLAOT_MONO_PATH=$(FULLAOT_TMP_DIR)
1010 endif
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)
1019 if !FULL_AOT_TESTS
1020         $(MAKE) fullaot-libs AOT_FLAGS="$(FULLAOT_AOT_ARGS)"
1021 endif
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
1037 llvmfullaotcheck:
1038         $(MAKE) fullaotcheck LLVM=1 GSHAREDVT=1
1040 llvmonly_regtests = $(fullaot_regtests) gshared.exe
1042 llvmonlycheck: mono $(llvmonly_regtests)
1043         rm -rf fullaot-tmp
1044         mkdir fullaot-tmp
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
1057 mbench: 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
1072 docu: mini.sgm
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)
1080 clean-local:
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 \
1089         TestHelpers.cs \
1090         genmdesc.py                             \
1091         $(test_sources)                         \
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            \
1104         $(posix_sources)                                        \
1105         test_op_il_seq_point.sh                 \
1106         test_op_il_seq_point_headerfooter.sh    \
1107         interp/whitebox-snippets.il             \
1108         Makefile.am.in
1110 if ENABLE_NETCORE
1111 version.h: Makefile
1112         echo "#define FULL_VERSION \"netcore\"" > version.h
1113 else
1114 version.h: Makefile
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`; \
1120                         else \
1121                                 branch="pull-request-$$ghprbPullId"; \
1122                         fi; \
1123                         version=`git log --no-color --first-parent -n1 --pretty=format:%h`; \
1124                         echo "#define FULL_VERSION \"$$branch/$$version\""; \
1125                 ); \
1126         else \
1127                 if test -z "$$MONO_BRANCH" -o -z "$$MONO_BUILD_REVISION"; then \
1128                         echo "#define FULL_VERSION \"tarball\""; \
1129                 else \
1130                         echo "#define FULL_VERSION \"$$MONO_BRANCH/$$MONO_BUILD_REVISION\""; \
1131                 fi \
1132         fi > version.h
1133 endif
1135 # Utility target for patching libtool to speed up linking
1136 patch-libtool:
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
1141 patch-osx-libtool:
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
1146 patch-automake:
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
1149 tags:
1150         etags -o TAGS `find .. -name "*.h" -o -name "*.c"`
1152 if ENABLE_LLVM
1153 llvm_makefile_dep = $(mono_build_root)/llvm/llvm_config.mk
1154 endif
1156 if HAS_EXTENSION_MODULE
1157 else
1158 Makefile.am: Makefile.am.in
1159         echo "##################### Generated from Makefile.am.in, do not modify ##########################" > $@
1160         cat $< >> $@
1162 endif
1164 # Per-library because linking doesn't like -xc++, it treats libraries as C++.
1165 CFLAGS := $(filter-out @CXX_REMOVE_CFLAGS@, @CFLAGS@)