2009-11-23 Zoltan Varga <vargaz@gmail.com>
[mono.git] / mono / mini / Makefile.am
index c7a16b8575aa321917632e97233bd72369a348c5..0dd0022a74858bea7694f3ae50ba49fce4e96299 100644 (file)
@@ -41,7 +41,7 @@ AM_CFLAGS = \
 
 AM_CXXFLAGS = $(LLVM_CXXFLAGS) $(GLIB_CFLAGS)
 
-if PLATFORM_WIN32
+if HOST_WIN32
 export HOST_CC
 # The mingw math.h has "extern inline" functions that dont appear in libs, so
 # optimisation is required to actually inline them
@@ -59,7 +59,7 @@ monoldflags=-Wl,-version-script=$(srcdir)/ldscript $(export_ldflags)
 monobinldflags=-Wl,-version-script=$(srcdir)/ldscript.mono $(export_ldflags)
 endif
 
-if PLATFORM_WIN32
+if HOST_WIN32
 libmono_la_LDFLAGS=-no-undefined -avoid-version -Wl,--kill-at $(monoldflags)
 else
 libmono_la_LDFLAGS=$(monoldflags)
@@ -67,7 +67,7 @@ endif
 
 if JIT_SUPPORTED
 
-if PLATFORM_WIN32
+if HOST_WIN32
 bin_PROGRAMS = mono monow
 else
 bin_PROGRAMS = mono
@@ -114,10 +114,11 @@ mono_LDADD = \
        $(GLIB_LIBS)            \
        $(LLVM_LIBS)            \
        -lm     \
-       $(MONO_DTRACE_OBJECT)
+       $(MONO_DTRACE_OBJECT) \
+       $(LLVM_LDFLAGS)
 
 mono_LDFLAGS = \
-       $(static_flags) -export-dynamic $(monobinldflags)
+       $(static_flags) -export-dynamic $(monobinldflags) $(monobin_platform_ldflags)
 
 if DTRACE_G_REQUIRED
 
@@ -132,7 +133,7 @@ mono-dtrace.$(OBJEXT): $(top_srcdir)/data/mono.d mini.lo $(monodir)/mono/metadat
 endif
 
 # Create monow.exe, linked for the 'windows' subsystem
-if PLATFORM_WIN32
+if HOST_WIN32
 monow_LDADD = $(mono_LDADD)
 monow_LDFLAGS = $(mono_LDFLAGS) -mwindows
 monow_SOURCES = $(mono_SOURCES)
@@ -224,10 +225,9 @@ 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
+llvm_sources = \
+       mini-llvm.c             \
+       mini-llvm-cpp.cpp
 endif
 
 common_sources = \
@@ -284,7 +284,9 @@ common_sources = \
        dwarfwriter.h   \
        dwarfwriter.c   \
        mini-gc.h               \
-       mini-gc.c
+       mini-gc.c               \
+       debugger-agent.h \
+       debugger-agent.c
 
 test_sources =                         \
        basic-calls.cs          \
@@ -304,6 +306,9 @@ test_sources =                      \
        basic-simd.cs
 
 if MONO_DEBUGGER_SUPPORTED
+if PLATFORM_DARWIN
+mono_debugger_arch_sources = mdb-debug-info32-darwin.s
+else
 if AMD64
 mono_debugger_arch_sources = mdb-debug-info64.s
 else
@@ -311,6 +316,7 @@ if X86
 mono_debugger_arch_sources = mdb-debug-info32.s
 endif
 endif
+endif
 mono_debugger_sources = debug-debugger.c debug-debugger.h $(mono_debugger_arch_sources)
 else
 mono_debugger_sources =
@@ -399,16 +405,19 @@ arch_built = cpu-hppa.h
 arch_define=__hppa__
 endif
 
-if PLATFORM_WIN32
+if HOST_WIN32
 os_sources = $(windows_sources)
+monobin_platform_ldflags=
 endif
 
 if PLATFORM_SIGPOSIX
 os_sources = $(posix_sources)
+monobin_platform_ldflags=
 endif
 
 if PLATFORM_DARWIN
 os_sources = $(darwin_sources) $(posix_sources)
+monobin_platform_ldflags=-sectcreate __TEXT __info_plist $(top_srcdir)/mono/mini/Info.plist
 endif
 
 libmono_la_SOURCES = $(common_sources) $(llvm_sources) $(arch_sources) $(os_sources)
@@ -515,7 +524,7 @@ aotcheck: mono $(regtests)
 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 $(CLASS)/mscorlib.dll $(CLASS)/System.Core.dll $(CLASS)/System.dll $(CLASS)/Mono.Posix.dll $(CLASS)/System.Configuration.dll $(CLASS)/System.Security.dll $(CLASS)/System.Xml.dll $(CLASS)/Mono.Security.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; MONO_PATH=fullaot-tmp $(top_builddir)/runtime/mono-wrapper --full-aot fullaot-tmp/$$i --exclude '!FULLAOT' || exit 1; done
@@ -555,7 +564,7 @@ BUILT_SOURCES = version.h
 endif
 
 CLEANFILES= $(BUILT_SOURCES) *.exe *.dll
-EXTRA_DIST = $(common_BURGSRC) cprop.c TestDriver.cs ldscript ldscript.mono \
+EXTRA_DIST = $(common_BURGSRC) TestDriver.cs ldscript ldscript.mono \
        genmdesc.pl     \
        $(test_sources) \
        $(x86_sources) cpu-x86.md \
@@ -570,17 +579,17 @@ EXTRA_DIST = $(common_BURGSRC) cprop.c TestDriver.cs ldscript ldscript.mono \
        $(alpha_sources) cpu-alpha.md \
        $(hppa_sources) cpu-hppa.md     \
        $(windows_sources)              \
-       $(darwin_sources)               \
+       $(darwin_sources) Info.plist    \
        $(posix_sources)
 
 version.h: Makefile
-       if test -d $(top_srcdir)/.git/svn; then svn_info='git svn info'; fi; \
+       if test -d $(top_srcdir)/.git/svn; then svn_info="git log --no-color --first-parent -n1 --grep=git-svn-id: --pretty=format:%b | sed -n -e 's,git-svn-id: \(.*\)@\(.*\) .*,URL: \1 Revision: \2,p'"; fi; \
        if test -d $(srcdir)/.svn; then svn_info='svn info'; fi; \
        if test -n "$$svn_info"; then \
                (cd $(top_srcdir); \
                        LANG=C; export LANG; \
-                       branch=`$$svn_info | grep URL | sed -e 's/.*source//' -e 's,mono/?$$,,'`; \
-                       version=`$$svn_info | grep Revision | sed 's/.*: //'`; \
+                       branch=`eval $$svn_info | sed -n -e '/URL/ s,.*source/\(.*\)/mono.*,/\1/mono,p'`; \
+                       version=`eval $$svn_info | sed -n -e '/Revision/ s/.*: //p'`; \
                        echo "#define FULL_VERSION \"$$branch r$$version\""; \
                ); \
        else \
@@ -591,3 +600,6 @@ version.h: Makefile
 patch-libtool:
        sed -e 's,if (for obj in $$oldobjs,if (for obj in "",g' < ../../libtool > 2; mv 2 ../../libtool
        chmod a+x ../../libtool
+
+tags:
+       etags -o TAGS `find .. -name "*.h" -o -name "*.c"`