Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mono / mini / Makefile.am.in
index 4e8d1bfd97a96fb72a10c1600d674094abb90901..28fb9ee5b8d2fdbc6a19ed9ea8541ad4814c313b 100755 (executable)
@@ -10,8 +10,13 @@ PLATFORM_PATH_SEPARATOR=:
 endif
 
 # This is needed for automake dependency generation
+if SUPPORT_NULLGC
+libgc_libs=
+libgc_static_libs=
+else
 libgc_libs=$(monodir)/libgc/libmonogc.la
 libgc_static_libs=$(monodir)/libgc/libmonogc-static.la
+endif
 
 boehm_libs=    \
        $(monodir)/mono/metadata/libmonoruntime.la      \
@@ -82,7 +87,7 @@ monobinldflags=$(export_ldflags) $(extra_runtime_ldflags)
 if HOST_WIN32
 libmonoldflags=-no-undefined -avoid-version -Wl,--kill-at $(monoldflags)
 else
-if PLATFORM_ANDROID
+if HOST_ANDROID
 libmonoldflags= -avoid-version $(monoldflags)
 else
 libmonoldflags=$(monoldflags) -version-info 1:0:0
@@ -163,7 +168,7 @@ if LOADED_LLVM
 lib_LTLIBRARIES += libmono-llvm.la
 libmono_llvm_la_SOURCES = mini-llvm.c mini-llvm-cpp.cpp llvm-jit.cpp
 libmono_llvm_la_LIBADD = $(GLIB_LIBS) $(LLVM_LIBS) $(LLVM_LDFLAGS)
-if PLATFORM_DARWIN
+if HOST_DARWIN
 libmono_llvm_la_LDFLAGS=-Wl,-undefined -Wl,suppress -Wl,-flat_namespace
 else
 libmono_llvm_la_LIBADD += $(top_builddir)/mono/mini/libmonoboehm-$(API_VER).la $(boehm_libs)
@@ -307,6 +312,12 @@ genmdesc_LDADD = \
        $(GLIB_LIBS)                                    \
        $(LIBICONV)
 
+wasm_sources = \
+       mini-wasm.c             \
+       mini-wasm.h             \
+       exceptions-wasm.c       \
+       tramp-wasm.c
+
 x86_sources = \
        mini-x86.c              \
        mini-x86.h              \
@@ -366,12 +377,6 @@ s390x_sources = \
        exceptions-s390x.c      \
        tramp-s390x.c
 
-ia64_sources = \
-       mini-ia64.c             \
-       mini-ia64.h             \
-       exceptions-ia64.c       \
-       tramp-ia64.c
-
 darwin_sources = \
        mini-darwin.c
 
@@ -407,6 +412,9 @@ interp_sources =    \
        interp/mintops.def      \
        interp/mintops.c        \
        interp/transform.c
+else
+interp_sources = \
+       interp/interp-stubs.c
 endif
 
 if ENABLE_LLVM
@@ -454,6 +462,7 @@ common_sources = \
        aot-compiler.h          \
        aot-compiler.c          \
        aot-runtime.c           \
+       aot-runtime-wasm.c      \
        graph.c                 \
        mini-codegen.c          \
        mini-exceptions.c       \
@@ -486,12 +495,14 @@ common_sources = \
        type-checking.c \
        lldb.h                  \
        lldb.c  \
-       memory-access.c
+       memory-access.c \
+       mini-profiler.c
 
 test_sources =                         \
        basic-calls.cs          \
        basic-long.cs           \
        bench.cs                \
+       builtin-types.cs        \
        objects.cs              \
        arrays.cs               \
        basic-float.cs          \
@@ -508,17 +519,16 @@ test_sources =                    \
        aot-tests.cs \
        gc-test.cs \
        gshared.cs \
+       unaligned.cs    \
+       MemoryIntrinsics.il     \
        mixed.cs
 
-if NACL_CODEGEN
-test_sources += nacl.cs
-endif
-
 regtests_UNIVERSAL = \
        basic.exe \
        basic-float.exe \
        basic-long.exe \
        basic-calls.exe \
+       builtin-types.exe \
        objects.exe \
        arrays.exe \
        basic-math.exe \
@@ -527,20 +537,23 @@ regtests_UNIVERSAL = \
        devirtualization.exe \
        generics.exe \
        basic-simd.exe \
+       unaligned.exe   \
        basic-vectors.exe
 
-if NACL_CODEGEN
-regtests_UNIVERSAL += nacl.exe
-endif
-
 regtests_DISABLED = 
 
 if FULL_AOT_TESTS
-regtests_DISABLED += 
+regtests_DISABLED += builtin-types.exe
 endif
 
 regtests = $(filter-out $(regtests_DISABLED),$(regtests_UNIVERSAL))
 
+if WASM
+arch_sources = $(wasm_sources)
+arch_built=cpu-wasm.h
+arch_define=__wasm__
+endif
+
 if X86
 arch_sources = $(x86_sources)
 arch_built=cpu-x86.h
@@ -604,23 +617,17 @@ arch_built=cpu-s390x.h
 arch_define=__s390__
 endif
 
-if IA64
-arch_sources = $(ia64_sources)
-arch_built = cpu-ia64.h
-arch_define=__ia64__
-endif
-
 if HOST_WIN32
 os_sources = $(windows_sources)
 monobin_platform_ldflags=
 endif
 
-if PLATFORM_SIGPOSIX
+if HOST_SIGPOSIX
 os_sources = $(posix_sources)
 monobin_platform_ldflags=
 endif
 
-if PLATFORM_DARWIN
+if HOST_DARWIN
 os_sources = $(darwin_sources) $(posix_sources)
 #monobin_platform_ldflags=-sectcreate __TEXT __info_plist $(top_srcdir)/mono/mini/Info.plist -framework CoreFoundation -framework Foundation
 monobin_platform_ldflags=-framework CoreFoundation -framework Foundation
@@ -660,12 +667,18 @@ basic-simd.exe: basic-simd.cs TestDriver.dll
 basic-vectors.exe: basic-vectors.cs TestDriver.dll
        $(MCS) -out:$@ $(CSFLAGS) $< -r:TestDriver.dll -r:$(CLASS)/System.Numerics.dll -r:$(CLASS)/System.Numerics.Vectors.dll
 
+builtin-types.exe: builtin-types.cs TestDriver.dll
+       $(MCS) -out:$@ $(CSFLAGS) -define:ARCH_$(shell echo $$((8 * $(SIZEOF_VOID_P)))) $< -r:TestDriver.dll
+
 nacl.exe: nacl.cs TestDriver.dll
        $(MCS) -out:$@ $(CSFLAGS) $< -r:TestDriver.dll -r:$(CLASS)/Mono.Simd.dll
 
 generics.exe: generics.cs TestDriver.dll generics-variant-types.dll
        $(MCS) -out:$@ $(CSFLAGS) $< -r:TestDriver.dll -r:generics-variant-types.dll -r:$(CLASS)/System.Core.dll
 
+unaligned.exe: unaligned.cs TestDriver.dll MemoryIntrinsics.dll
+       $(MCS) -out:$@ $(CSFLAGS) $< -r:TestDriver.dll -r:MemoryIntrinsics.dll
+
 %.exe: %.cs TestDriver.dll
        $(MCS) -out:$@ $(CSFLAGS) $< -r:TestDriver.dll
 
@@ -678,26 +691,29 @@ TestDriver.dll: $(srcdir)/TestDriver.cs $(srcdir)/TestHelpers.cs
 generics-variant-types.dll: generics-variant-types.il
        $(ILASM) -dll -output=$@ $<
 
-if NACL_CODEGEN
-GENMDESC_OPTS=--nacl
-else !NACL_CODEGEN
+MemoryIntrinsics.dll: MemoryIntrinsics.il
+       $(ILASM) -dll -output=$@ $<
+
 GENMDESC_OPTS=
-endif !NACL_CODEGEN
 
 # we don't always use the perl impl because it's an additional
 # build dependency for the poor windows users
 # $(arch_define) is the preprocessor symbol that enables all the opcodes
 # for the specific platform in mini-ops.h
+
 if CROSS_COMPILING
 GENMDESC_PRG=perl $(srcdir)/genmdesc.pl $(arch_define) $(srcdir) $(GENMDESC_OPTS)
-else !CROSS_COMPILING
-if NACL_CODEGEN
+else
+if WASM
 GENMDESC_PRG=perl $(srcdir)/genmdesc.pl $(arch_define) $(srcdir) $(GENMDESC_OPTS)
 else
 GENMDESC_PRG=./genmdesc $(GENMDESC_OPTS)
 endif
 endif !CROSS_COMPILING
 
+cpu-wasm.h: cpu-wasm.md genmdesc$(EXEEXT)
+       $(GENMDESC_PRG) cpu-wasm.h wasm_desc $(srcdir)/cpu-wasm.md
+
 cpu-x86.h: cpu-x86.md genmdesc$(EXEEXT)
        $(GENMDESC_PRG) cpu-x86.h x86_desc $(srcdir)/cpu-x86.md
 
@@ -722,9 +738,6 @@ cpu-sparc.h: cpu-sparc.md genmdesc$(EXEEXT)
 cpu-s390x.h: cpu-s390x.md genmdesc$(EXEEXT)
        $(GENMDESC_PRG) cpu-s390x.h s390x_cpu_desc $(srcdir)/cpu-s390x.md
 
-cpu-ia64.h: cpu-ia64.md genmdesc$(EXEEXT)
-       $(GENMDESC_PRG) cpu-ia64.h ia64_desc $(srcdir)/cpu-ia64.md
-
 cpu-mips.h: cpu-mips.md genmdesc$(EXEEXT)
        $(GENMDESC_PRG) cpu-mips.h mips_desc $(srcdir)/cpu-mips.md
 
@@ -785,6 +798,7 @@ gsharedvtcheck:
        $(MAKE) fullaotcheck GSHAREDVT=1
 
 fullaot_regtests = $(regtests) aot-tests.exe $(if $(GSHAREDVT),gshared.exe)
+fullaot_testing_deps = generics-variant-types.dll TestDriver.dll MemoryIntrinsics.dll
 
 FULLAOT_LIBS_UNIVERSAL = \
        mscorlib.dll \
@@ -810,17 +824,18 @@ FULLAOT_LIBS_DISABLED += \
        System.Configuration.dll
 endif
 
+
 FULLAOT_LIBS = $(filter-out $(FULLAOT_LIBS_DISABLED),$(FULLAOT_LIBS_UNIVERSAL))
 
 FULLAOT_TMP_DIR=$(top_builddir)/mono/mini/fullaot-tmp
 
 # This currently only works on amd64/arm
-fullaotcheck: $(mono) $(fullaot_regtests)
+fullaotcheck: $(mono) $(fullaot_regtests) $(fullaot_testing_deps)
        rm -rf $(FULLAOT_TMP_DIR)
        mkdir $(FULLAOT_TMP_DIR)
        $(MAKE) fullaot-libs AOT_FLAGS="full,$(MONO_FULLAOT_ADDITIONAL_ARGS)$(INVARIANT_AOT_OPTIONS)" GSHAREDVT=$(GSHAREDVT)
-       cp $(regtests) $(fullaot_regtests) generics-variant-types.dll TestDriver.dll $(FULLAOT_TMP_DIR)/
-       MONO_PATH=$(FULLAOT_TMP_DIR) $(top_builddir)/runtime/mono-wrapper $(MOBILE_RUNTIME_ARG) $(LLVM_AOT_RUNTIME_OPTS) $(GSHAREDVT_RUNTIME_OPTS) --aot="full,$(MONO_FULLAOT_ADDITIONAL_ARGS)$(INVARIANT_AOT_OPTIONS)" $(FULLAOT_TMP_DIR)/{generics-variant-types.dll,TestDriver.dll,*.exe} || exit 1
+       cp $(regtests) $(fullaot_regtests) $(fullaot_testing_deps) $(FULLAOT_TMP_DIR)/
+       MONO_PATH=$(FULLAOT_TMP_DIR) $(top_builddir)/runtime/mono-wrapper $(MOBILE_RUNTIME_ARG) $(LLVM_AOT_RUNTIME_OPTS) $(GSHAREDVT_RUNTIME_OPTS) --aot="full,$(MONO_FULLAOT_ADDITIONAL_ARGS)$(INVARIANT_AOT_OPTIONS)" $(FULLAOT_TMP_DIR)/{*.dll,*.exe} || exit 1
        ln -s $(if $(MONO_EXECUTABLE),$(MONO_EXECUTABLE),$$PWD/mono) $(FULLAOT_TMP_DIR)/
        for i in $(fullaot_regtests); do echo $$i; MONO_PATH=$(FULLAOT_TMP_DIR) $(top_builddir)/runtime/mono-wrapper $(MOBILE_RUNTIME_ARG) --full-aot $(FULLAOT_TMP_DIR)/$$i --exclude '!FULLAOT' $(ARCH_FULLAOT_EXCLUDE) || exit 1; done
 
@@ -842,8 +857,8 @@ llvmonlycheck: mono $(llvmonly_regtests)
        rm -rf fullaot-tmp
        mkdir fullaot-tmp
        $(MAKE) fullaot-libs AOT_FLAGS="llvmonly,$(MONO_FULLAOT_ADDITIONAL_ARGS)$(INVARIANT_AOT_OPTIONS)"
-       cp $(llvmonly_regtests) generics-variant-types.dll TestDriver.dll fullaot-tmp/
-       MONO_PATH=fullaot-tmp $(top_builddir)/runtime/mono-wrapper  $(MOBILE_RUNTIME_ARG) --aot=llvmonly fullaot-tmp/{generics-variant-types.dll,TestDriver.dll,*.exe} || exit 1
+       cp $(llvmonly_regtests) $(fullaot_testing_deps) fullaot-tmp/
+       MONO_PATH=fullaot-tmp $(top_builddir)/runtime/mono-wrapper  $(MOBILE_RUNTIME_ARG) --aot=llvmonly fullaot-tmp/{*.dll,*.exe} || exit 1
        ln -s $$PWD/mono fullaot-tmp/
        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
 
@@ -888,6 +903,7 @@ EXTRA_DIST = TestDriver.cs \
        TestHelpers.cs \
        genmdesc.pl                             \
        $(test_sources)                         \
+       $(wasm_sources) cpu-wasm.md             \
        $(x86_sources) cpu-x86.md               \
        $(amd64_sources) cpu-amd64.md           \
        $(ppc_sources) cpu-ppc.md cpu-ppc64.md  \
@@ -896,7 +912,6 @@ EXTRA_DIST = TestDriver.cs \
        $(mips_sources) cpu-mips.md             \
        $(sparc_sources) cpu-sparc.md           \
        $(s390x_sources) cpu-s390x.md           \
-       $(ia64_sources) cpu-ia64.md             \
        $(windows_sources)                      \
        $(darwin_sources) Info.plist            \
        $(posix_sources)                                        \