Make the var/mvar caches per-image, since the generic params they refer to can be...
[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 if SHARED_MONO
32 bin_PROGRAMS = pedump
33 endif
34
35 #
36 # libtool is not capable of creating static/shared versions of the same
37 # convenience lib, so we have to do it ourselves
38 #
39 if SUPPORT_SGEN
40 if SHARED_MONO
41 shared_sgen_libraries = libmonoruntimesgen.la 
42 endif
43 sgen_libraries = $(shared_sgen_libraries) libmonoruntimesgen-static.la 
44 endif
45
46 if MOONLIGHT
47 moonlight_libraries = libmonoruntimemoon.la
48 moon-do-build: libmonoruntime-static.la libmonoruntimemoon.la
49 moon-do-clean:
50         -test -z "libmonoruntime-static.la" || rm -f libmonoruntime-static.la
51         -test -z "libmonoruntimemoon.la" || rm -f libmonoruntimemoon.la
52 endif
53
54 if SHARED_MONO
55 shared_libraries = libmonoruntime.la
56 endif
57 noinst_LTLIBRARIES =  $(shared_libraries) libmonoruntime-static.la $(sgen_libraries) $(moonlight_libraries)
58
59 INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/mono $(LIBGC_CFLAGS) $(GLIB_CFLAGS) -DMONO_BINDIR=\"$(bindir)/\" -DMONO_ASSEMBLIES=\"$(assembliesdir)\" -DMONO_CFG_DIR=\"$(confdir)\"
60
61 #
62 # Make sure any prefix changes are updated in the binaries too.
63 #
64 #  assembly.c uses MONO_ASSEMBLIES
65 #  mono-config.c uses MONO_CFG_DIR
66 #
67 # This won't result in many more false positives than AC_DEFINEing them
68 # in configure.in.
69 #
70 assembly.lo mono-config.lo: Makefile
71
72 CLEANFILES = mono-bundle.stamp
73
74 libmonoruntime_static_la_LIBADD = $(bundle_obj) $(libmonoruntime_la_LIBADD)
75
76 null_sources = \
77         console-null.c
78
79 sgen_sources = \
80         sgen-cardtable.c        \
81         sgen-gray.c             \
82         sgen-pinning.c          \
83         sgen-pinning-stats.c    \
84         sgen-workers.c
85
86 libmonoruntime_la_SOURCES = \
87         $(platform_sources)     \
88         appdomain.c             \
89         assembly.c              \
90         attach.h                \
91         attach.c                \
92         boehm-gc.c              \
93         char-conversions.h      \
94         cil-coff.h              \
95         class.c                 \
96         class-internals.h       \
97         cominterop.c            \
98         cominterop.h            \
99         console-io.h            \
100         coree.c                 \
101         coree.h                 \
102         culture-info.h          \
103         culture-info-tables.h   \
104         debug-helpers.c         \
105         debug-mono-symfile.h    \
106         debug-mono-symfile.c    \
107         decimal.c               \
108         decimal.h               \
109         domain.c                \
110         domain-internals.h      \
111         environment.c           \
112         environment.h           \
113         exception.c             \
114         exception.h             \
115         file-io.c               \
116         file-io.h               \
117         filewatcher.c           \
118         filewatcher.h           \
119         gc.c                    \
120         gc-internal.h           \
121         icall.c                 \
122         icall-def.h             \
123         image.c                 \
124         loader.c                \
125         locales.c               \
126         locales.h               \
127         lock-tracer.c           \
128         lock-tracer.h           \
129         marshal.c               \
130         marshal.h               \
131         mempool.c               \
132         mempool.h               \
133         mempool-internals.h     \
134         metadata.c              \
135         metadata-verify.c       \
136         metadata-internals.h    \
137         method-builder.h        \
138         method-builder.c        \
139         mono-basic-block.c      \
140         mono-basic-block.h      \
141         mono-config.c           \
142         mono-cq.c               \
143         mono-cq.h               \
144         mono-debug.h            \
145         mono-debug.c            \
146         mono-debug-debugger.h   \
147         mono-debug-debugger.c   \
148         mono-endian.c           \
149         mono-endian.h           \
150         mono-hash.c             \
151         mono-hash.h             \
152         mono-mlist.c            \
153         mono-mlist.h            \
154         mono-perfcounters.c     \
155         mono-perfcounters.h     \
156         mono-perfcounters-def.h \
157         mono-ptr-array.h        \
158         mono-wsq.c              \
159         mono-wsq.h              \
160         monitor.c               \
161         monitor.h               \
162         nacl-stub.c             \
163         normalization-tables.h  \
164         null-gc.c               \
165         number-formatter.h      \
166         object.c                \
167         object-internals.h      \
168         opcodes.c               \
169         socket-io.c             \
170         socket-io.h             \
171         process.c               \
172         process.h               \
173         profiler.c              \
174         profiler-private.h      \
175         rand.h                  \
176         rand.c                  \
177         runtime.c               \
178         reflection.c            \
179         security.c              \
180         security.h              \
181         security-core-clr.c     \
182         security-core-clr.h     \
183         security-manager.c      \
184         security-manager.h      \
185         sgen-os-posix.c         \
186         sgen-os-mach.c          \
187         sgen-gc.c               \
188         sgen-internal.c         \
189         sgen-marksweep.c        \
190         sgen-marksweep-fixed.c  \
191         sgen-marksweep-par.c    \
192         sgen-marksweep-fixed-par.c      \
193         sgen-major-copying.c    \
194         sgen-los.c              \
195         sgen-protocol.c \
196         sgen-bridge.c           \
197         sgen-bridge.h           \
198         sgen-gc.h               \
199         sgen-archdep.h          \
200         sgen-cardtable.h        \
201         sgen-major-copy-object.h \
202         sgen-major-scan-object.h \
203         sgen-protocol.h         \
204         sgen-scan-object.h      \
205         string-icalls.c         \
206         string-icalls.h         \
207         sysmath.h               \
208         sysmath.c               \
209         tabledefs.h             \
210         threads.c               \
211         threads-types.h         \
212         threadpool.c            \
213         threadpool.h            \
214         threadpool-internals.h  \
215         verify.c                \
216         verify-internals.h      \
217         wrapper-types.h
218
219 libmonoruntime_la_CFLAGS = $(BOEHM_DEFINES)
220
221 if MOONLIGHT
222 libmonoruntimemoon_la_SOURCES = $(libmonoruntime_la_SOURCES)
223 if MOONLIGHT_BOEHM
224 libmonoruntimemoon_la_CFLAGS = $(MOONLIGHT_DEFINES) $(BOEHM_DEFINES)
225 else
226 libmonoruntimemoon_la_CFLAGS = $(MOONLIGHT_DEFINES) $(SGEN_DEFINES)
227 endif
228 endif
229
230 libmonoruntimesgen_la_SOURCES = $(libmonoruntime_la_SOURCES)
231 libmonoruntimesgen_la_CFLAGS = $(SGEN_DEFINES)
232
233 libmonoruntime_static_la_SOURCES = $(libmonoruntime_la_SOURCES)
234 libmonoruntime_static_la_LDFLAGS = -static
235 libmonoruntime_static_la_CFLAGS = $(BOEHM_DEFINES)
236
237 libmonoruntimesgen_static_la_SOURCES = $(libmonoruntime_la_SOURCES)
238 libmonoruntimesgen_static_la_LDFLAGS = -static
239 libmonoruntimesgen_static_la_CFLAGS = $(SGEN_DEFINES)
240
241 libmonoruntimeincludedir = $(includedir)/mono-$(API_VER)/mono/metadata
242
243 libmonoruntimeinclude_HEADERS = \
244         assembly.h              \
245         attrdefs.h              \
246         appdomain.h             \
247         blob.h                  \
248         class.h                 \
249         debug-helpers.h         \
250         debug-mono-symfile.h    \
251         threads.h               \
252         environment.h           \
253         exception.h             \
254         image.h                 \
255         loader.h                \
256         metadata.h              \
257         mono-config.h           \
258         mono-debug.h            \
259         mono-gc.h               \
260         sgen-bridge.h           \
261         object.h                \
262         opcodes.h               \
263         profiler.h              \
264         reflection.h            \
265         row-indexes.h           \
266         tokentype.h             \
267         verify.h                
268
269 if DTRACE_G_REQUIRED
270
271 PEDUMP_DTRACE_OBJECT = pedump-dtrace.$(OBJEXT)
272
273 pedump-dtrace.$(OBJEXT): $(top_srcdir)/data/mono.d libmonoruntime.la ../io-layer/libwapi.la ../utils/libmonoutils.la
274         DTRACE="$(DTRACE)" DTRACEFLAGS="$(DTRACEFLAGS)" AR="$(AR)" $(SHELL) $(top_srcdir)/data/dtrace-prelink.sh \
275         --pic pedump-dtrace.$(OBJEXT) $(top_srcdir)/data/mono.d libmonoruntime.la ../io-layer/libwapi.la ../utils/libmonoutils.la
276
277 else
278 PEDUMP_DTRACE_OBJECT = 
279 endif
280
281 if SHARED_MONO
282 pedump_SOURCES =                \
283         pedump.c
284
285 pedump_LDADD = libmonoruntime.la ../io-layer/libwapi.la ../utils/libmonoutils.la \
286         $(LIBGC_LIBS) $(GLIB_LIBS) -lm $(PEDUMP_DTRACE_OBJECT)
287
288 if PLATFORM_DARWIN
289 pedump_LDFLAGS=-framework CoreFoundation
290 endif
291 endif
292
293 EXTRA_DIST = make-bundle.pl sample-bundle $(win32_sources) $(unix_sources) $(null_sources) $(sgen_sources) runtime.h \
294                 tpool-poll.c tpool-epoll.c tpool-kqueue.c
295