2006-06-20 Jb Evain <jbevain@gmail.com>
[mono.git] / mono / mini / Makefile.am
index 7c019c53c78b5b0fc17fdd927b37be2dc176207f..d0decf49b44dd00da05f988859c9f5bb02c1e114 100644 (file)
@@ -29,10 +29,16 @@ static_libs=        \
        $(libgc_static_libs) \
        $(ICU_LIBS)
 
-RUNTIME = MONO_PATH=$(mcs_topdir)/class/lib/default $(top_builddir)/runtime/mono-wrapper
+CLASS1=$(mcs_topdir)/class/lib/default
+CLASS2=$(mcs_topdir)/class/lib/net_2_0
 
-MCS = $(RUNTIME) $(mcs_topdir)/class/lib/default/mcs.exe -unsafe -nowarn:0162
-ILASM = $(RUNTIME) $(mcs_topdir)/class/lib/default/ilasm.exe
+RUNTIME = MONO_PATH=$(CLASS1) $(top_builddir)/runtime/mono-wrapper
+RUNTIME2 = MONO_PATH=$(CLASS2) $(top_builddir)/runtime/mono-wrapper
+
+MCS = $(RUNTIME) $(CLASS1)/mcs.exe -unsafe -nowarn:0162
+GMCS = $(RUNTIME2) $(CLASS2)/gmcs.exe -unsafe -nowarn:0162
+ILASM = $(RUNTIME) $(CLASS1)/ilasm.exe
+ILASM2 = $(RUNTIME2) $(CLASS2)/ilasm.exe
 
 AM_CFLAGS = \
        -I$(top_srcdir)         \
@@ -48,8 +54,6 @@ export HOST_CC
 PLATFORM_CFLAGS = -O
 endif
 
-PLATFORM_LIB = ../os/libmonoos.la
-
 # hack for automake to have the same source file in a library and a bin
 genmdesc_CFLAGS = $(AM_CFLAGS)
 
@@ -89,7 +93,6 @@ endif
 
 mono_LDADD = \
        $(MONO_LIB)                     \
-       $(PLATFORM_LIB)         \
        $(GLIB_LIBS)            \
        $(GMODULE_LIBS) -lm     \
        $(ICU_LIBS)
@@ -105,7 +108,6 @@ genmdesc_SOURCES = \
 # Don't link this against libmonoruntime to speed up rebuilds
 genmdesc_LDADD = \
        $(monodir)/mono/utils/libmonoutils.la $(monodir)/mono/metadata/opcodes.lo -lm   \
-       $(PLATFORM_LIB)         \
        $(GLIB_LIBS)            \
        $(GMODULE_LIBS)
 
@@ -157,6 +159,7 @@ s390x_sources = \
        mini-s390x.c            \
        mini-s390x.h            \
        exceptions-s390x.c      \
+       mini-codegen.c          \
        tramp-s390x.c
 
 ia64_sources = \
@@ -170,6 +173,8 @@ ia64_sources = \
 common_sources = \
        mini.c          \
        mini.h          \
+       jit-icalls.h \
+       jit-icalls.c \
        trace.c         \
        trace.h         \
        mini-ops.h      \
@@ -187,16 +192,19 @@ common_sources = \
        ssapre.h        \
        aliasing.c      \
        aliasing.h      \
-       ssapre-cee-ops.h \
-       ssapre-mini-ops.h \
+       local-propagation.c     \
+       simple-cee-ops.h \
+       simple-mini-ops.h \
        driver.c        \
        debug-mini.c    \
        linear-scan.c   \
-       aot.c           \
+       aot-compiler.c          \
+       aot-runtime.c           \
        graph.c         \
        mini-exceptions.c       \
        declsec.c       \
        declsec.h       \
+       wapihandles.c   \
        branch-opts.c
 
 test_sources =                 \
@@ -212,29 +220,36 @@ test_sources =            \
        iltests.il              \
        test.cs
 
+test_sources2 = generics.2.cs il2tests.2.il
+
+if MONO_DEBUGGER_SUPPORTED
+mono_debugger_sources = debug-debugger.c debug-debugger.h
+else
+mono_debugger_sources =
+endif
+
 regtests=basic.exe arrays.exe basic-float.exe basic-math.exe basic-long.exe objects.exe basic-calls.exe iltests.exe exceptions.exe bench.exe
+regtests2=generics.exe il2tests.exe
 
 common_BURGSRC= $(srcdir)/inssel.brg $(srcdir)/inssel-float.brg
 
 if X86
-libmono_la_SOURCES = \
-       $(common_sources) $(x86_sources)
-
+arch_sources = \
+       $(x86_sources) $(mono_debugger_sources)
 arch_BURGSRC= $(srcdir)/inssel-long32.brg $(srcdir)/inssel-x86.brg
 arch_built=cpu-pentium.h
 endif
 
 if AMD64
-libmono_la_SOURCES = \
-       $(common_sources) $(amd64_sources)
+arch_sources = \
+       $(amd64_sources) $(mono_debugger_sources)
 arch_BURGSRC= $(srcdir)/inssel-long.brg $(srcdir)/inssel-amd64.brg
 arch_built=cpu-amd64.h
 endif
 
 if POWERPC
-libmono_la_SOURCES = \
-       $(common_sources) $(ppc_sources)
-
+arch_sources = \
+       $(ppc_sources)
 arch_BURGSRC= $(srcdir)/inssel-long32.brg $(srcdir)/inssel-ppc.brg
 arch_built=cpu-g4.h
 endif
@@ -244,59 +259,60 @@ if ARM
 # pick up arm_dpimacros.h and arm_fpamacros.h
 ARCH_CFLAGS = -I../arch/arm
 
-libmono_la_SOURCES = \
-       $(common_sources) $(arm_sources)
+arch_sources = $(arm_sources)
 
 arch_BURGSRC= $(srcdir)/inssel-long32.brg $(srcdir)/inssel-arm.brg
 arch_built=cpu-arm.h
 endif
 
 if SPARC
-libmono_la_SOURCES = \
-       $(common_sources) $(sparc_sources)
+arch_sources = \
+       $(sparc_sources)
 
 arch_BURGSRC= $(srcdir)/inssel-long32.brg $(srcdir)/inssel-sparc.brg
 arch_built=cpu-sparc.h
 endif
 
 if SPARC64
-libmono_la_SOURCES = \
-       $(common_sources) $(sparc_sources)
+arch_sources = \
+       $(sparc_sources)
 
 arch_BURGSRC= $(srcdir)/inssel-long.brg $(srcdir)/inssel-sparc.brg
 arch_built=cpu-sparc.h
 endif
 
 if S390
-libmono_la_SOURCES = \
-       $(common_sources) $(s390_sources)
+arch_sources = \
+       $(s390_sources)
 
 arch_BURGSRC= $(srcdir)/inssel-long32.brg $(srcdir)/inssel-s390.brg
 arch_built=cpu-s390.h
 endif
 
 if S390x
-libmono_la_SOURCES = \
-       $(common_sources) $(s390x_sources)
+arch_sources = \
+       $(s390x_sources)
 
 arch_BURGSRC= $(srcdir)/inssel-long.brg $(srcdir)/inssel-s390x.brg
 arch_built=cpu-s390x.h
 endif
 
 if IA64
-libmono_la_SOURCES = \
-    $(common_sources) $(ia64_sources)
+arch_sources = \
+    $(ia64_sources)
 
 arch_BURGSRC = $(srcdir)/inssel-long.brg $(srcdir)/inssel-ia64.brg
 arch_built = cpu-ia64.h
 endif
 
+libmono_la_SOURCES = $(common_sources) $(arch_sources)
+
 nodist_libmono_la_SOURCES = inssel.c inssel.h
 
 libmono_static_la_SOURCES = $(libmono_la_SOURCES)
 nodist_libmono_static_la_SOURCES = $(nodist_libmono_la_SOURCES)
 libmono_static_la_LDFLAGS = -static
-libmono_static_la_LIBADD = $(static_libs) $(PLATFORM_LIB)
+libmono_static_la_LIBADD = $(static_libs)
 
 BURGSRC= $(common_BURGSRC) $(arch_BURGSRC)
 
@@ -305,17 +321,22 @@ libmonoincludedir = $(includedir)/mono/jit
 libmonoinclude_HEADERS = jit.h
 
 libmono_la_LIBADD = \
-       $(libs) \
-       $(PLATFORM_LIB)
+       $(libs)
+
+%.exe: %.2.cs TestDriver.dll
+       $(GMCS) -out:$@ $< -r:TestDriver.dll 
 
 %.exe: %.cs TestDriver.dll
-       $(MCS) /out:$*.exe /unsafe $< /r:TestDriver.dll
+       $(MCS) -out:$@ -unsafe $< -r:TestDriver.dll
+
+%.exe: %.2.il
+       $(ILASM2) -output=$@ $<
 
 %.exe: %.il
-       $(ILASM) /output=$*.exe $<
+       $(ILASM) -output=$@ $<
 
 TestDriver.dll: $(srcdir)/TestDriver.cs
-       $(MCS) /out:TestDriver.dll /target:library $(srcdir)/TestDriver.cs
+       $(MCS) -out:$@ -target:library $<
 
 if CROSS_COMPILING
 
@@ -371,12 +392,18 @@ testi: mono test.exe
 checktests: $(regtests)
        for i in $(regtests); do $(RUNTIME) $$i; done
 
-rcheck: mono $(regtests)
+checktests2: $(regtests2)
+       for i in $(regtests); do $(RUNTIME2) $$i; done
+
+rcheck: mono $(regtests) $(regtests2)
        $(RUNTIME) --regression $(regtests)
+       $(RUNTIME2) --regression $(regtests2)
 
 aotcheck: mono $(regtests)
        for i in $(regtests); do $(RUNTIME) --aot $$i; done
+       for i in $(regtests2); do $(RUNTIME2) --aot $$i; done
        $(RUNTIME) --verbose --regression $(regtests)
+       $(RUNTIME2) --verbose --regression $(regtests2)
        rm -f *.exe.so
 
 bench: mono test.exe
@@ -412,7 +439,8 @@ BUILT_SOURCES= inssel.c inssel.h $(arch_built)
 endif
 
 CLEANFILES= $(BUILT_SOURCES) *.exe *.dll
-EXTRA_DIST = $(common_BURGSRC) jit-icalls.c cprop.c TestDriver.cs ldscript ldscript.mono $(test_sources) \
+EXTRA_DIST = $(common_BURGSRC) cprop.c TestDriver.cs ldscript ldscript.mono \
+       $(test_sources) $(test_sources2) \
        inssel-long.brg inssel-long32.brg \
        $(x86_sources) inssel-x86.brg cpu-pentium.md \
        $(amd64_sources) inssel-amd64.brg cpu-amd64.md \