2010-04-19 Zoltan Varga <vargaz@gmail.com>
[mono.git] / mono / metadata / Makefile.am
1 if HOST_WIN32
2 win32_sources = \
3         console-win32.c
4
5 platform_sources = $(win32_sources)
6
7 # Use -m here. This will use / as directory separator (C:/WINNT).
8 # The files that use MONO_ASSEMBLIES and/or MONO_CFG_DIR replace the
9 # / by \ if running under WIN32.
10 if CROSS_COMPILING
11 assembliesdir = ${libdir}
12 confdir = ${sysconfdir}
13 else
14 assembliesdir = `cygpath -m "${libdir}"`
15 confdir = `cygpath -m "${sysconfdir}"`
16 endif
17 export HOST_CC
18 # The mingw math.h has "extern inline" functions that dont appear in libs, so
19 # optimisation is required to actually inline them
20 AM_CFLAGS = -O
21 else
22
23 assembliesdir = $(exec_prefix)/lib
24 confdir = $(sysconfdir)
25 unix_sources = \
26         console-unix.c
27
28 platform_sources = $(unix_sources)
29 endif
30
31 bin_PROGRAMS = pedump
32
33 #
34 # libtool is not capable of creating static/shared versions of the same
35 # convenience lib, so we have to do it ourselves
36 #
37 noinst_LTLIBRARIES = libmonoruntime.la libmonoruntime-static.la
38
39 INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/mono $(LIBGC_CFLAGS) $(GLIB_CFLAGS) -DMONO_BINDIR=\"$(bindir)/\" -DMONO_ASSEMBLIES=\"$(assembliesdir)\" -DMONO_CFG_DIR=\"$(confdir)\"
40
41 #
42 # Make sure any prefix changes are updated in the binaries too.
43 #
44 #  assembly.c uses MONO_ASSEMBLIES
45 #  mono-config.c uses MONO_CFG_DIR
46 #
47 # This won't result in many more false positives than AC_DEFINEing them
48 # in configure.in.
49 #
50 assembly.lo mono-config.lo: Makefile
51
52 CLEANFILES = mono-bundle.stamp
53
54 libmonoruntime_static_la_LIBADD = $(bundle_obj) $(libmonoruntime_la_LIBADD)
55
56 null_sources = \
57         console-null.c
58
59 sgen_sources = \
60         sgen-gray.c     \
61         sgen-pinning.c  \
62         sgen-pinning-stats.c
63
64 libmonoruntime_la_SOURCES = \
65         $(platform_sources)     \
66         appdomain.c             \
67         assembly.c              \
68         attach.h                \
69         attach.c                \
70         boehm-gc.c              \
71         char-conversions.h      \
72         cil-coff.h              \
73         class.c                 \
74         class-internals.h       \
75         cominterop.c            \
76         cominterop.h            \
77         console-io.h            \
78         coree.c                 \
79         coree.h                 \
80         culture-info.h          \
81         culture-info-tables.h   \
82         debug-helpers.c         \
83         debug-mono-symfile.h    \
84         debug-mono-symfile.c    \
85         decimal.c               \
86         decimal.h               \
87         domain.c                \
88         domain-internals.h      \
89         environment.c           \
90         environment.h           \
91         exception.c             \
92         exception.h             \
93         file-io.c               \
94         file-io.h               \
95         filewatcher.c           \
96         filewatcher.h           \
97         gc.c                    \
98         gc-internal.h           \
99         icall.c                 \
100         icall-def.h             \
101         image.c                 \
102         loader.c                \
103         locales.c               \
104         locales.h               \
105         lock-tracer.c           \
106         lock-tracer.h           \
107         marshal.c               \
108         marshal.h               \
109         mempool.c               \
110         mempool.h               \
111         mempool-internals.h     \
112         metadata.c              \
113         metadata-verify.c       \
114         metadata-internals.h    \
115         method-builder.h        \
116         method-builder.c        \
117         mono-basic-block.c      \
118         mono-basic-block.h      \
119         mono-config.c           \
120         mono-debug.h            \
121         mono-debug.c            \
122         mono-debug-debugger.h   \
123         mono-debug-debugger.c   \
124         mono-endian.c           \
125         mono-endian.h           \
126         mono-mlist.c            \
127         mono-mlist.h            \
128         mono-perfcounters.c     \
129         mono-perfcounters.h     \
130         mono-perfcounters-def.h \
131         mono-wsq.c              \
132         mono-wsq.h              \
133         monitor.c               \
134         monitor.h               \
135         normalization-tables.h  \
136         null-gc.c               \
137         number-formatter.h      \
138         object.c                \
139         object-internals.h      \
140         opcodes.c               \
141         socket-io.c             \
142         socket-io.h             \
143         process.c               \
144         process.h               \
145         profiler.c              \
146         profiler-private.h      \
147         rand.h                  \
148         rand.c                  \
149         reflection.c            \
150         security.c              \
151         security.h              \
152         security-core-clr.c     \
153         security-core-clr.h     \
154         security-manager.c      \
155         security-manager.h      \
156         sgen-gc.c               \
157         sgen-gc.h               \
158         sgen-archdep.h          \
159         sgen-scan-object.h      \
160         string-icalls.c         \
161         string-icalls.h         \
162         sysmath.h               \
163         sysmath.c               \
164         tabledefs.h             \
165         threads.c               \
166         threads-types.h         \
167         threadpool.c            \
168         threadpool.h            \
169         threadpool-internals.h  \
170         verify.c                \
171         verify-internals.h      \
172         wrapper-types.h
173
174 libmonoruntime_static_la_SOURCES = $(libmonoruntime_la_SOURCES)
175
176 libmonoruntime_static_la_LDFLAGS = -static
177
178 libmonoruntimeincludedir = $(includedir)/mono-$(API_VER)/mono/metadata
179
180 libmonoruntimeinclude_HEADERS = \
181         assembly.h              \
182         attrdefs.h              \
183         appdomain.h             \
184         blob.h                  \
185         class.h                 \
186         debug-helpers.h         \
187         debug-mono-symfile.h    \
188         threads.h               \
189         environment.h           \
190         exception.h             \
191         image.h                 \
192         loader.h                \
193         metadata.h              \
194         mono-config.h           \
195         mono-debug.h            \
196         mono-gc.h               \
197         object.h                \
198         opcodes.h               \
199         profiler.h              \
200         reflection.h            \
201         row-indexes.h           \
202         tokentype.h             \
203         verify.h                
204
205 if DTRACE_G_REQUIRED
206
207 PEDUMP_DTRACE_OBJECT = pedump-dtrace.$(OBJEXT)
208
209 pedump-dtrace.$(OBJEXT): $(top_srcdir)/data/mono.d libmonoruntime.la ../io-layer/libwapi.la ../utils/libmonoutils.la
210         DTRACE="$(DTRACE)" DTRACEFLAGS="$(DTRACEFLAGS)" AR="$(AR)" $(SHELL) $(top_srcdir)/data/dtrace-prelink.sh \
211         --pic pedump-dtrace.$(OBJEXT) $(top_srcdir)/data/mono.d libmonoruntime.la ../io-layer/libwapi.la ../utils/libmonoutils.la
212
213 else
214 PEDUMP_DTRACE_OBJECT = 
215 endif
216
217 pedump_SOURCES =                \
218         pedump.c
219
220 pedump_LDADD = libmonoruntime.la ../io-layer/libwapi.la ../utils/libmonoutils.la \
221         $(LIBGC_LIBS) $(GLIB_LIBS) -lm $(PEDUMP_DTRACE_OBJECT)
222
223 if PLATFORM_DARWIN
224 pedump_LDFLAGS=-framework CoreFoundation
225 endif
226
227 EXTRA_DIST = make-bundle.pl sample-bundle $(win32_sources) $(unix_sources) $(null_sources) $(sgen_sources)
228