2009-05-11 Zoltan Varga <vargaz@gmail.com>
[mono.git] / mono / mini / Makefile.am
index c0df396fc5f4e0ad112741ad1f706cf8c3a0ccf1..8ded24c5b667ba2da7bfa4fab1e07b9386ed40cb 100644 (file)
@@ -36,9 +36,11 @@ ILASM = $(RUNTIME) $(CLASS)/ilasm.exe
 AM_CFLAGS = \
        -I$(top_srcdir)         \
        $(LIBGC_CFLAGS)         \
-       $(GLIB_CFLAGS)
+       $(GLIB_CFLAGS)          \
        $(PLATFORM_CFLAGS) $(ARCH_CFLAGS)
 
+AM_CXXFLAGS = $(LLVM_CXXFLAGS) $(GLIB_CFLAGS)
+
 if PLATFORM_WIN32
 export HOST_CC
 # The mingw math.h has "extern inline" functions that dont appear in libs, so
@@ -110,6 +112,7 @@ endif
 mono_LDADD = \
        $(MONO_LIB)                     \
        $(GLIB_LIBS)            \
+       $(LLVM_LIBS)            \
        -lm     \
        $(MONO_DTRACE_OBJECT)
 
@@ -119,11 +122,11 @@ mono_LDFLAGS = \
 if DTRACE_G_REQUIRED
 
 mono-dtrace.$(OBJEXT): $(top_srcdir)/data/mono.d mini.lo $(monodir)/mono/metadata/libmonoruntime-static.la
-       DTRACE="$(DTRACE)" DTRACEFLAGS="$(DTRACEFLAGS)" AR="$(AR)" $(SHELL) $(top_srcdir)/dtrace-prelink.sh \
+       DTRACE="$(DTRACE)" DTRACEFLAGS="$(DTRACEFLAGS)" AR="$(AR)" $(SHELL) $(top_srcdir)/data/dtrace-prelink.sh \
        $@ $(top_srcdir)/data/mono.d $(monodir)/mono/metadata/libmonoruntime-static.la mini.lo
 
 .libs/mono-dtrace.$(OBJEXT): $(top_srcdir)/data/mono.d mini.lo $(monodir)/mono/metadata/libmonoruntime.la
-       DTRACE="$(DTRACE)" DTRACEFLAGS="$(DTRACEFLAGS)" AR="$(AR)" $(SHELL) $(top_srcdir)/dtrace-prelink.sh \
+       DTRACE="$(DTRACE)" DTRACEFLAGS="$(DTRACEFLAGS)" AR="$(AR)" $(SHELL) $(top_srcdir)/data/dtrace-prelink.sh \
        --pic $@ $(top_srcdir)/data/mono.d $(monodir)/mono/metadata/libmonoruntime.la mini.lo
 
 endif
@@ -163,12 +166,6 @@ ppc_sources = \
        exceptions-ppc.c        \
        tramp-ppc.c
 
-ppc64_sources = \
-       mini-ppc64.c            \
-       mini-ppc.h              \
-       exceptions-ppc.c        \
-       tramp-ppc.c
-
 arm_sources = \
        mini-arm.c              \
        mini-arm.h              \
@@ -200,86 +197,110 @@ s390x_sources = \
        tramp-s390x.c
 
 ia64_sources = \
-       mini-ia64.c                     \
-       mini-ia64.h                     \
+       mini-ia64.c             \
+       mini-ia64.h             \
        exceptions-ia64.c       \
        tramp-ia64.c
 
 alpha_sources = \
-       mini-alpha.c    \
-       mini-alpha.h    \
+       mini-alpha.c            \
+       mini-alpha.h            \
        exceptions-alpha.c      \
        tramp-alpha.c
 
 hppa_sources = \
-       mini-hppa.c     \
-       mini-hppa.h     \
+       mini-hppa.c             \
+       mini-hppa.h             \
        exceptions-hppa.c       \
        tramp-hppa.c
 
+darwin_sources = \
+       mini-darwin.c
+
+windows_sources = \
+       mini-windows.c
+
+posix_sources = \
+       mini-posix.c
+
+if ENABLE_LLVM
+# Disabled for now to fix the windows build
+#llvm_sources = \
+#      mini-llvm.c             \
+#      mini-llvm-cpp.cpp
+endif
+
 common_sources = \
-       mini.c          \
-       ir-emit.h       \
-       method-to-ir.c  \
-       decompose.c     \
-       mini.h          \
-       version.h       \
+       mini.c                  \
+       ir-emit.h               \
+       method-to-ir.c          \
+       decompose.c             \
+       mini.h                  \
+       version.h               \
        optflags-def.h          \
-       jit-icalls.h \
-       jit-icalls.c \
-       trace.c         \
-       trace.h         \
-       patch-info.h    \
-       mini-ops.h      \
-       mini-arch.h     \
-       dominators.c    \
-       cfold.c         \
-       regalloc.c      \
-       regalloc.h      \
-       helpers.c       \
-       liveness.c      \
-       ssa.c           \
-       abcremoval.c    \
-       abcremoval.h    \
-       ssapre.c        \
-       ssapre.h        \
+       jit-icalls.h            \
+       jit-icalls.c            \
+       trace.c                 \
+       trace.h                 \
+       patch-info.h            \
+       mini-ops.h              \
+       mini-arch.h             \
+       dominators.c            \
+       cfold.c                 \
+       regalloc.c              \
+       regalloc.h              \
+       helpers.c               \
+       liveness.c              \
+       ssa.c                   \
+       abcremoval.c            \
+       abcremoval.h            \
+       ssapre.c                \
+       ssapre.h                \
        local-propagation.c     \
-       driver.c        \
-       debug-mini.c    \
-       debug-mini.h    \
-       linear-scan.c   \
+       driver.c                \
+       debug-mini.c            \
+       debug-mini.h            \
+       linear-scan.c           \
        aot-compiler.c          \
        aot-runtime.c           \
-       graph.c         \
-       mini-exceptions.c       \
+       graph.c                 \
        mini-codegen.c          \
-       mini-trampolines.c  \
-       declsec.c       \
-       declsec.h       \
-       wapihandles.c   \
-       branch-opts.c   \
-       generic-sharing.c       \
-       regalloc2.c     \
-       simd-methods.h  \
+       mini-exceptions.c       \
+       mini-trampolines.c      \
+       declsec.c               \
+       declsec.h               \
+       wapihandles.c           \
+       branch-opts.c           \
+       mini-generic-sharing.c  \
+       regalloc2.c             \
+       simd-methods.h          \
+       tasklets.c              \
+       tasklets.h              \
        simd-intrinsics.c       \
-       unwind.h        \
-       unwind.c
-
-test_sources =                 \
-       basic-calls.cs  \
-       basic-long.cs   \
+       unwind.h                \
+       unwind.c                \
+       image-writer.h  \
+       image-writer.c  \
+       dwarfwriter.h   \
+       dwarfwriter.c   \
+       mini-gc.h               \
+       mini-gc.c
+
+test_sources =                         \
+       basic-calls.cs          \
+       basic-long.cs           \
        bench.cs                \
        objects.cs              \
        arrays.cs               \
-       basic-float.cs  \
-       basic-math.cs   \
+       basic-float.cs          \
+       basic-math.cs           \
        basic.cs                \
-       exceptions.cs   \
+       exceptions.cs           \
        devirtualization.cs     \
        iltests.il.in           \
        test.cs                 \
-       generics.cs     \
-       generics-variant-types.il       \
+       generics.cs             \
+       generics-variant-types.il\
        basic-simd.cs
 
 if MONO_DEBUGGER_SUPPORTED
@@ -316,7 +337,7 @@ arch_define=__ppc__
 endif
 
 if POWERPC64
-arch_sources = $(ppc64_sources)
+arch_sources = $(ppc_sources)
 arch_built=cpu-ppc64.h
 arch_define=__ppc64__
 endif
@@ -379,7 +400,19 @@ arch_built = cpu-hppa.h
 arch_define=__hppa__
 endif
 
-libmono_la_SOURCES = $(common_sources) $(arch_sources)
+if PLATFORM_WIN32
+os_sources = $(windows_sources)
+endif
+
+if PLATFORM_SIGPOSIX
+os_sources = $(posix_sources)
+endif
+
+if PLATFORM_DARWIN
+os_sources = $(darwin_sources) $(posix_sources)
+endif
+
+libmono_la_SOURCES = $(common_sources) $(llvm_sources) $(arch_sources) $(os_sources)
 
 libmono_static_la_SOURCES = $(libmono_la_SOURCES)
 nodist_libmono_static_la_SOURCES = $(nodist_libmono_la_SOURCES)
@@ -428,40 +461,40 @@ GENMDESC_PRG=./genmdesc
 endif !CROSS_COMPILING
 
 cpu-x86.h: cpu-x86.md genmdesc$(EXEEXT)
-       $(GENMDESC_PRG) $(srcdir)/cpu-x86.md cpu-x86.h x86_desc
+       $(GENMDESC_PRG) cpu-x86.h x86_desc $(srcdir)/cpu-x86.md
 
 cpu-amd64.h: cpu-amd64.md genmdesc$(EXEEXT)
-       $(GENMDESC_PRG) $(srcdir)/cpu-amd64.md cpu-amd64.h amd64_desc
+       $(GENMDESC_PRG) cpu-amd64.h amd64_desc $(srcdir)/cpu-amd64.md
 
 cpu-ppc.h: cpu-ppc.md genmdesc$(EXEEXT)
-       $(GENMDESC_PRG) $(srcdir)/cpu-ppc.md cpu-ppc.h ppcg4
+       $(GENMDESC_PRG) cpu-ppc.h ppcg4 $(srcdir)/cpu-ppc.md
 
 cpu-ppc64.h: cpu-ppc64.md genmdesc$(EXEEXT)
-       $(GENMDESC_PRG) $(srcdir)/cpu-ppc64.md cpu-ppc64.h ppc64_cpu_desc
+       $(GENMDESC_PRG) cpu-ppc64.h ppc64_cpu_desc $(srcdir)/cpu-ppc64.md
 
 cpu-arm.h: cpu-arm.md genmdesc$(EXEEXT)
-       $(GENMDESC_PRG) $(srcdir)/cpu-arm.md cpu-arm.h arm_cpu_desc
+       $(GENMDESC_PRG) cpu-arm.h arm_cpu_desc $(srcdir)/cpu-arm.md
 
 cpu-sparc.h: cpu-sparc.md genmdesc$(EXEEXT)
-       $(GENMDESC_PRG) $(srcdir)/cpu-sparc.md cpu-sparc.h sparc_desc
+       $(GENMDESC_PRG) cpu-sparc.h sparc_desc $(srcdir)/cpu-sparc.md
 
 cpu-s390.h: cpu-s390.md genmdesc$(EXEEXT)
-       $(GENMDESC_PRG) $(srcdir)/cpu-s390.md cpu-s390.h s390_cpu_desc
+       $(GENMDESC_PRG) cpu-s390.h s390_cpu_desc $(srcdir)/cpu-s390.md
 
 cpu-s390x.h: cpu-s390x.md genmdesc$(EXEEXT)
-       $(GENMDESC_PRG) $(srcdir)/cpu-s390x.md cpu-s390x.h s390x_cpu_desc
+       $(GENMDESC_PRG) cpu-s390x.h s390x_cpu_desc $(srcdir)/cpu-s390x.md
 
 cpu-ia64.h: cpu-ia64.md genmdesc$(EXEEXT)
-       $(GENMDESC_PRG) $(srcdir)/cpu-ia64.md cpu-ia64.h ia64_desc
+       $(GENMDESC_PRG) cpu-ia64.h ia64_desc $(srcdir)/cpu-ia64.md
 
 cpu-alpha.h: cpu-alpha.md genmdesc$(EXEEXT)
-       $(GENMDESC_PRG) $(srcdir)/cpu-alpha.md cpu-alpha.h alpha_desc
+       $(GENMDESC_PRG) cpu-alpha.h alpha_desc $(srcdir)/cpu-alpha.md
 
 cpu-hppa.h: cpu-hppa.md genmdesc$(EXEEXT)
-       $(GENMDESC_PRG) $(srcdir)/cpu-hppa.md cpu-hppa.h hppa_desc
+       $(GENMDESC_PRG) cpu-hppa.h hppa_desc $(srcdir)/cpu-hppa.md
 
 cpu-mips.h: cpu-mips.md genmdesc$(EXEEXT)
-       $(GENMDESC_PRG) $(srcdir)/cpu-mips.md cpu-mips.h mips_desc
+       $(GENMDESC_PRG) cpu-mips.h mips_desc $(srcdir)/cpu-mips.md
 
 testi: mono test.exe
        $(RUNTIME) -v -v --ncompile 1 --compile Test:$(mtest) test.exe
@@ -479,6 +512,15 @@ aotcheck: mono $(regtests)
        for i in $(regtests); do $(RUNTIME_AOTCHECK) --regression $$i || exit 1; done
        rm -f *.exe.so
 
+# This currently only works on amd64/arm
+fullaotcheck: mono $(regtests)
+       rm -rf fullaot-tmp
+       mkdir fullaot-tmp
+       cp $(CLASS)/mscorlib.dll $(CLASS)/Mono.Simd.dll $(regtests) generics-variant-types.dll TestDriver.dll fullaot-tmp/
+       cp $(regtests) fullaot-tmp/
+       MONO_PATH=fullaot-tmp $(top_builddir)/runtime/mono-wrapper --aot=full fullaot-tmp/* || exit 1
+       for i in $(regtests); do echo $$i; if [ $$i != generics.exe ]; then MONO_PATH=fullaot-tmp $(top_builddir)/runtime/mono-wrapper --full-aot fullaot-tmp/$$i || exit 1; fi; done
+
 bench: mono test.exe
        time env $(RUNTIME) --ncompile $(count) --compile Test:$(mtest) test.exe
 
@@ -527,7 +569,10 @@ EXTRA_DIST = $(common_BURGSRC) cprop.c TestDriver.cs ldscript ldscript.mono \
        $(s390x_sources) cpu-s390x.md \
        $(ia64_sources) cpu-ia64.md \
        $(alpha_sources) cpu-alpha.md \
-       $(hppa_sources) cpu-hppa.md
+       $(hppa_sources) cpu-hppa.md     \
+       $(windows_sources)              \
+       $(darwin_sources)               \
+       $(posix_sources)
 
 version.h: Makefile
        if test -d $(top_srcdir)/.git/svn; then svn_info='git svn info'; fi; \
@@ -546,4 +591,4 @@ version.h: Makefile
 # Utility target for patching libtool to speed up linking
 patch-libtool:
        sed -e 's,if (for obj in $$oldobjs,if (for obj in "",g' < ../../libtool > 2; mv 2 ../../libtool
-       chmod a+x ../../libtool
\ No newline at end of file
+       chmod a+x ../../libtool