2004-09-03 Zoltan Varga <vargaz@freemail.hu>
[mono.git] / mono / metadata / Makefile.am
index 4366d333ba0120bb22a89345e17272741628a24a..9f2044f78e2471f7802496db025c84abbd56b233 100644 (file)
-noinst_PROGRAMS = pedump
+if PLATFORM_WIN32
+export HOST_CC
+# Use -m here. This will use / as directory separator (C:/WINNT).
+# The files that use MONO_ASSEMBLIES and/or MONO_CFG_DIR replace the
+# / by \ if running under WIN32.
+assembliesdir = `cygpath -m "${libdir}"`
+confdir = `cygpath -m "${sysconfdir}"`
+# 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
+else
+assembliesdir = $(libdir)
+confdir = $(sysconfdir)
+endif
 
-lib_LIBRARIES = libmetadata.a
+bin_PROGRAMS = pedump
 
 #
-# Keep in sync with mono/runtime/Makefile.am
+# libtool is not capable of creating static/shared versions of the same
+# convenience lib, so we have to do it ourselves
 #
-assembliesdir = $(libdir)
+noinst_LTLIBRARIES = libmetadata.la libmonoruntime.la libmetadata-static.la libmonoruntime-static.la
 
-INCLUDES = $(GLIB_CFLAGS) $(GMODULE_CFLAGS) -I$(top_srcdir)    \
-       -DMONO_ASSEMBLIES=\""$(assembliesdir)"\"                
 
+INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/mono $(LIBGC_CFLAGS) $(GLIB_CFLAGS) $(GMODULE_CFLAGS) $(ICU_CFLAGS) \
+       -DMONO_ASSEMBLIES=\"$(assembliesdir)\" -DMONO_CFG_DIR=\"$(confdir)\"
+
+if WITH_BUNDLE
+bundle_srcs = mono-bundle.s mono-bundle.h
+bundle_obj = mono-bundle.o
+#BUILT_SOURCES = $(bundle_srcs)
+
+$(bundle_obj): $(bundle_srcs)
+$(bundle_srcs): mono-bundle.stamp
+       @if test -f $@; then :; else rm -f mono-bundle.stamp; $(MAKE) mono-bundle.stamp; fi
+mono-bundle.stamp: $(BUNDLE_FILE) $(srcdir)/make-bundle.pl
+       echo stamp > $@t
+       perl $(srcdir)/make-bundle.pl $(BUNDLE_FILE) mono-bundle.h mono-bundle.s
+       mv $@t $@
 
-if THREADS_PTHREAD
-THREAD_SOURCE = \
-       threads-pthread.c       \
-       threads-pthread.h       \
-       threads-pthread-types.c \
-       threads-pthread-types.h \
-       #
-else
-THREAD_SOURCE = \
-       threads-dummy.h         \
-       threads-dummy.c         \
-       threads-dummy-types.c   \
-       threads-dummy-types.h   \
-       #
 endif
 
-libmetadata_a_SOURCES = \
+CLEANFILES = mono-bundle.stamp
+
+libmetadata_la_LIBADD = $(bundle_obj) $(PLATFORM_LIB)
+
+libmonoruntime_static_la_LIBADD = $(libmonoruntime_la_LIBADD)
+libmetadata_static_la_LIBADD = $(libmetadata_la_LIBADD)
+
+libmonoruntime_la_SOURCES = \
+       reflection.c    \
+       object.c        \
+       object-internals.h      \
+       icall.c         \
+       char-conversions.h \
+       decimal.c       \
+       decimal.h       \
+       gc.c            \
+       gc-internal.h   \
+       marshal.c       \
+       marshal.h       \
+       monitor.c       \
+       monitor.h       \
+       threads.c       \
+       threads-types.h \
+       threadpool.c    \
+       threadpool.h    \
+       file-io.c       \
+       file-io.h       \
+       socket-io.c     \
+       socket-io.h     \
+       exception.c     \
+       exception.h     \
+       unicode.c       \
+       unicode.h       \
+       appdomain.c     \
+       debug-mono-symfile.h    \
+       debug-mono-symfile.c    \
+       mono-debug.h            \
+       mono-debug.c            \
+       mono-debug-debugger.h   \
+       mono-debug-debugger.c   \
+       profiler.c      \
+       profiler-private.h      \
+       rand.h          \
+       rand.c          \
+       security.c      \
+       security.h      \
+       string-icalls.c \
+       string-icalls.h \
+       sysmath.h       \
+       sysmath.c       \
+       process.c       \
+       process.h       \
+       environment.c   \
+       environment.h   \
+       locales.c       \
+       locales.h       \
+       filewatcher.c   \
+       filewatcher.h   \
+       culture-info.h  \
+       culture-info-tables.h
+
+libmetadata_la_SOURCES = \
        assembly.c      \
+       domain.c        \
+       domain-internals.h      \
+       opcodes.c       \
        image.c         \
+       cil-coff.h      \
+       tabledefs.h     \
        metadata.c      \
+       metadata-internals.h    \
+       verify.c        \
+       mono-endian.c   \
+       mono-endian.h   \
+       mono-config.c   \
+       mono-config.h   \
        private.h       \
        rawbuffer.c     \
-       reflection.c    \
+       rawbuffer.h     \
        loader.c        \
        class.c         \
-       object.c        \
-       icall.c         \
-       threads.h       \
-       threads-types.h \
-       $(THREAD_SOURCE)        \
-       #
+       class-internals.h               \
+       mempool.c       \
+       debug-helpers.c
+
+libmetadata_static_la_SOURCES = $(libmetadata_la_SOURCES)
+libmonoruntime_static_la_SOURCES = $(libmonoruntime_la_SOURCES)
+
+libmetadata_static_la_LDFLAGS = -static
+libmonoruntime_static_la_LDFLAGS = -static
 
 libmetadataincludedir = $(includedir)/mono/metadata
+libmonoruntimeincludedir = $(includedir)/mono/metadata
+
+libmonoruntimeinclude_HEADERS = \
+       appdomain.h     \
+       mono-debug.h    \
+       mono-debug-debugger.h   \
+       debug-mono-symfile.h    \
+       threads.h       \
+       environment.h
 
 libmetadatainclude_HEADERS = \
        assembly.h      \
+       opcodes.h       \
        blob.h          \
-       cil-coff.h      \
-       mono-endian.h   \
        image.h         \
        metadata.h      \
-       rawbuffer.h     \
+       verify.h        \
        reflection.h    \
        row-indexes.h   \
-       tabledefs.h     \
        tokentype.h     \
        loader.h        \
        class.h         \
-       object.h        
+       object.h        \
+       exception.h     \
+       profiler.h      \
+       appdomain.h     \
+       debug-helpers.h \
+       mempool.h
 
 pedump_SOURCES =               \
-       pedump.c $(libmetadata_a_SOURCES)
+       pedump.c
 
-pedump_LDADD = $(GLIB_LIBS) $(GMODULE_LIBS) $(THREAD_LIBS)
+pedump_LDADD = libmetadata.la ../io-layer/libwapi.la ../utils/libmonoutils.la \
+       $(LIBGC_LIBS) $(GLIB_LIBS) $(GMODULE_LIBS) -lm
 
+EXTRA_DIST = make-bundle.pl sample-bundle