2005-07-20 Zoltan Varga <vargaz@freemail.hu>
[mono.git] / mono / mini / Makefile.am
index 5d99c8df007ef87eae4ce13a9a27e09d9fac4692..97aa5487bdb0c9f465968c4a680d5fde5131aa2d 100644 (file)
@@ -13,7 +13,6 @@ endif
 
 libs=  \
        $(monodir)/mono/metadata/libmonoruntime.la      \
-       $(monodir)/mono/metadata/libmetadata.la \
        $(monodir)/mono/io-layer/libwapi.la     \
        $(monodir)/mono/utils/libmonoutils.la \
        $(GMODULE_LIBS) \
@@ -23,7 +22,6 @@ libs= \
 
 static_libs=   \
        $(monodir)/mono/metadata/libmonoruntime-static.la       \
-       $(monodir)/mono/metadata/libmetadata-static.la  \
        $(monodir)/mono/io-layer/libwapi.la     \
        $(monodir)/mono/utils/libmonoutils.la \
        $(GMODULE_LIBS) \
@@ -31,8 +29,10 @@ static_libs= \
        $(libgc_static_libs) \
        $(ICU_LIBS)
 
-MCS=mcs
-RUNTIME=mono
+RUNTIME = MONO_PATH=$(mcs_topdir)/class/lib/default $(top_builddir)/runtime/mono-wrapper
+
+MCS = $(RUNTIME) $(mcs_topdir)/class/lib/default/mcs.exe -unsafe -nowarn:0162
+ILASM = $(RUNTIME) $(mcs_topdir)/ilasm/ilasm.exe
 
 INCLUDES = \
        -I$(top_srcdir)         \
@@ -45,6 +45,7 @@ export HOST_CC
 # The mingw math.h has "extern inline" functions that dont appear in libs, so
 # optimisation is required to actually inline them
 AM_CFLAGS = -O
+PLATFORM_LIB = ../os/libmonoos.la
 endif
 
 # hack for automake to have the same source file in a library and a bin
@@ -84,6 +85,7 @@ endif
 
 mono_LDADD = \
        $(MONO_LIB)                     \
+       $(PLATFORM_LIB)         \
        $(GLIB_LIBS)            \
        $(GMODULE_LIBS) -lm     \
        $(ICU_LIBS)
@@ -96,25 +98,28 @@ genmdesc_SOURCES = \
        genmdesc.c      \
        helpers.c
 
-# Don't link this against libmetadata to speed up rebuilds
+# 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)
 
 x86_sources = \
-    mini-exceptions.c  \
        mini-x86.c              \
        mini-x86.h              \
        exceptions-x86.c        \
-       tramp-x86.c
+       tramp-x86.c                     \
+       mini-codegen.c          \
+       mini-trampolines.c
 
 amd64_sources = \
-       mini-exceptions.c       \
        mini-amd64.c            \
        mini-amd64.h            \
        exceptions-amd64.c      \
-       tramp-amd64.c
+       tramp-amd64.c           \
+       mini-codegen.c          \
+       mini-trampolines.c
 
 ppc_sources = \
        mini-ppc.c              \
@@ -125,9 +130,10 @@ ppc_sources = \
 sparc_sources = \
        mini-sparc.c            \
        mini-sparc.h            \
-    mini-exceptions.c  \
        exceptions-sparc.c      \
-       tramp-sparc.c
+       tramp-sparc.c           \
+       mini-codegen.c          \
+       mini-trampolines.c
 
 s390_sources = \
        mini-s390.c             \
@@ -141,6 +147,14 @@ s390x_sources = \
        exceptions-s390x.c      \
        tramp-s390x.c
 
+ia64_sources = \
+       mini-ia64.c                     \
+       mini-ia64.h                     \
+       exceptions-ia64.c       \
+       tramp-ia64.c            \
+       mini-codegen.c          \
+       mini-trampolines.c
+
 common_sources = \
        mini.c          \
        mini.h          \
@@ -157,11 +171,16 @@ common_sources = \
        ssa.c           \
        abcremoval.c    \
        abcremoval.h    \
+       ssapre.c        \
+       ssapre.h        \
+       ssapre-cee-ops.h \
+       ssapre-mini-ops.h \
        driver.c        \
        debug-mini.c    \
        linear-scan.c   \
        aot.c           \
        graph.c         \
+       mini-exceptions.c       \
        declsec.c       \
        declsec.h
 
@@ -237,12 +256,20 @@ 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_BURGSRC = $(srcdir)/inssel-long.brg $(srcdir)/inssel-ia64.brg
+arch_built = cpu-ia64.h
+endif
+
 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)
+libmono_static_la_LIBADD = $(static_libs) $(PLATFORM_LIB)
 
 BURGSRC= $(common_BURGSRC) $(arch_BURGSRC)
 
@@ -251,13 +278,14 @@ libmonoincludedir = $(includedir)/mono/jit
 libmonoinclude_HEADERS = jit.h
 
 libmono_la_LIBADD = \
-       $(libs)
+       $(libs) \
+       $(PLATFORM_LIB)
 
 %.exe: %.cs TestDriver.dll
        $(MCS) /out:$*.exe /unsafe $< /r:TestDriver.dll
 
 %.exe: %.il
-       ilasm /output=$*.exe $<
+       $(ILASM) /output=$*.exe $<
 
 TestDriver.dll: $(srcdir)/TestDriver.cs
        $(MCS) /out:TestDriver.dll /target:library $(srcdir)/TestDriver.cs
@@ -280,45 +308,52 @@ cpu-s390.h: cpu-s390.md genmdesc$(EXEEXT)
 cpu-s390x.h: cpu-s390x.md genmdesc$(EXEEXT)
        ./genmdesc $(srcdir)/cpu-s390x.md cpu-s390x.h s390x
 
+cpu-ia64.h: cpu-ia64.md genmdesc$(EXEEXT)
+       ./genmdesc $(srcdir)/cpu-ia64.md cpu-ia64.h ia64_desc
+
 inssel.c inssel.h: $(BURGSRC)
        $(monodir)/mono/monoburg/monoburg -c 1 -p -e $(BURGSRC) -d inssel.h -s inssel.c
 
 testi: mono test.exe
-       ./mono -v -v --ncompile 1 --compile Test:$(mtest) test.exe
+       $(RUNTIME) -v -v --ncompile 1 --compile Test:$(mtest) test.exe
 
 # ensure the tests are actually correct
 checktests: $(regtests)
        for i in $(regtests); do $(RUNTIME) $$i; done
 
 rcheck: mono $(regtests)
-       ./mono --regression $(regtests)
+       $(RUNTIME) --regression $(regtests)
 
 aotcheck: mono $(regtests)
-       for i in $(regtests); do ./mono --aot $$i; done
-       ./mono --verbose --regression $(regtests)
+       for i in $(regtests); do $(RUNTIME) --aot $$i; done
+       $(RUNTIME) --verbose --regression $(regtests)
        rm -f *.exe.so
 
 bench: mono test.exe
-       time ./mono --ncompile $(count) --compile Test:$(mtest) test.exe
+       time env $(RUNTIME) --ncompile $(count) --compile Test:$(mtest) test.exe
 
 mbench: test.exe
        time $(monodir)/mono/jit/mono --ncompile $(count) --compile Test:$(mtest) test.exe
 
 stat1: mono bench.exe
-       ./mono --verbose --statfile stats.pl --regression bench.exe
+       $(RUNTIME) --verbose --statfile stats.pl --regression bench.exe
        perl viewstat.pl stats.pl
 
 stat2: mono basic.exe
-       ./mono --verbose --statfile stats.pl --regression basic.exe
+       $(RUNTIME) --verbose --statfile stats.pl --regression basic.exe
        perl viewstat.pl -e stats.pl
 
 stat3: mono bench.exe
-       ./mono --statfile stats.pl --ncompile 1000 --compile Tests:test_0_many_nested_loops bench.exe 
+       $(RUNTIME) --statfile stats.pl --ncompile 1000 --compile Tests:test_0_many_nested_loops bench.exe 
        perl viewstat.pl stats.pl
 
 docu: mini.sgm
        docbook2txt mini.sgm
 
+check-local:
+       ok=:; $(MAKE) rcheck || ok=false; \
+       $(top_builddir)/runtime/semdel-wrapper || :; $$ok
+
 clean-local:
        rm -f mono a.out gmon.out *.o test.exe
 
@@ -328,7 +363,7 @@ if JIT_SUPPORTED
 BUILT_SOURCES= inssel.c inssel.h $(arch_built)
 endif
 
-CLEANFILES= $(BUILT_SOURCES)
+CLEANFILES= $(BUILT_SOURCES) *.exe *.dll
 EXTRA_DIST = $(common_BURGSRC) jit-icalls.c cprop.c TestDriver.cs ldscript $(test_sources) \
        inssel-long.brg inssel-long32.brg \
        $(x86_sources) inssel-x86.brg cpu-pentium.md \
@@ -336,5 +371,5 @@ EXTRA_DIST = $(common_BURGSRC) jit-icalls.c cprop.c TestDriver.cs ldscript $(tes
        $(ppc_sources) inssel-ppc.brg cpu-g4.md \
        $(sparc_sources) inssel-sparc.brg cpu-sparc.md \
        $(s390_sources) inssel-s390.brg cpu-s390.md \
-       $(s390x_sources) inssel-s390x.brg cpu-s390x.md
-
+       $(s390x_sources) inssel-s390x.brg cpu-s390x.md \
+       $(ia64_sources) inssel-ia64.brg cpu-ia64.md