Merge branch 'feature-concurrent-sweep'
[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 PLATFORM_ANDROID
32 platform_sources += ../../support/libm/complex.c
33 endif
34
35 if SHARED_MONO
36 if SUPPORT_BOEHM
37 bin_PROGRAMS = pedump
38 endif
39 endif
40
41 #
42 # libtool is not capable of creating static/shared versions of the same
43 # convenience lib, so we have to do it ourselves
44 #
45 if SUPPORT_SGEN
46 if DISABLE_EXECUTABLES
47 shared_sgen_libraries = libmonoruntimesgen.la 
48 else
49 if SHARED_MONO
50 shared_sgen_libraries = libmonoruntimesgen.la 
51 endif
52 endif
53 sgen_libraries = $(shared_sgen_libraries) libmonoruntimesgen-static.la 
54 endif
55
56 if SUPPORT_BOEHM
57 if DISABLE_EXECUTABLES
58 shared_boehm_libraries = libmonoruntime.la
59 else
60 if SHARED_MONO
61 shared_boehm_libraries = libmonoruntime.la
62 endif
63 endif
64 boehm_libraries = $(shared_boehm_libraries) libmonoruntime-static.la
65 endif
66
67 if DISABLE_EXECUTABLES
68 noinst_LTLIBRARIES = libmonoruntime-config.la $(shared_sgen_libraries) $(shared_boehm_libraries)
69 else
70 noinst_LTLIBRARIES = libmonoruntime-config.la $(boehm_libraries) $(sgen_libraries)
71 endif
72
73 AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/mono $(LIBGC_CPPFLAGS) $(GLIB_CFLAGS) $(SHARED_CFLAGS)
74
75 #
76 # Make sure any prefix changes are updated in the binaries too.
77 #
78 # This won't result in many more false positives than AC_DEFINEing them
79 # in configure.ac.
80 #
81 mono-config-dirs.lo: Makefile
82
83 #
84 # This library is used to localize the usage of MONO_BINDIR etc. to just one source file, thus enabling
85 # ccache to work even if the value of these defines change. We need to use a convenience library since automake
86 # doesn't support per file cflags.
87 #
88 libmonoruntime_config_la_SOURCES = \
89         mono-config-dirs.h              \
90         mono-config-dirs.c
91 libmonoruntime_config_la_CPPFLAGS = $(AM_CPPFLAGS) -DMONO_BINDIR=\"$(bindir)/\" -DMONO_ASSEMBLIES=\"$(assembliesdir)\" -DMONO_CFG_DIR=\"$(confdir)\"
92
93 CLEANFILES = mono-bundle.stamp
94
95 null_sources = \
96         console-null.c
97
98 null_gc_sources = \
99         null-gc.c
100
101 common_sources = \
102         $(platform_sources)     \
103         assembly.c              \
104         attach.h                \
105         attach.c                \
106         char-conversions.h      \
107         cil-coff.h              \
108         class.c                 \
109         class-internals.h       \
110         cominterop.c            \
111         cominterop.h            \
112         console-io.h            \
113         coree.c                 \
114         coree.h                 \
115         culture-info.h          \
116         culture-info-tables.h   \
117         debug-helpers.c         \
118         debug-mono-symfile.h    \
119         debug-mono-symfile.c    \
120         decimal-ms.c            \
121         decimal-ms.h            \
122         domain-internals.h      \
123         environment.c           \
124         environment.h           \
125         exception.c             \
126         exception.h             \
127         file-io.c               \
128         file-io.h               \
129         filewatcher.c           \
130         filewatcher.h           \
131         gc-internal.h           \
132         gc-memfuncs.c           \
133         icall.c                 \
134         icall-def.h             \
135         image.c                 \
136         jit-info.c              \
137         loader.c                \
138         locales.c               \
139         locales.h               \
140         lock-tracer.c           \
141         lock-tracer.h           \
142         marshal.c               \
143         marshal.h               \
144         mempool.c               \
145         mempool.h               \
146         mempool-internals.h     \
147         metadata.c              \
148         metadata-verify.c       \
149         metadata-internals.h    \
150         method-builder.h        \
151         method-builder.c        \
152         mono-basic-block.c      \
153         mono-basic-block.h      \
154         mono-config.c           \
155         mono-cq.c               \
156         mono-cq.h               \
157         mono-debug.h            \
158         mono-debug.c            \
159         mono-debug-debugger.h   \
160         mono-endian.c           \
161         mono-endian.h           \
162         mono-hash.h             \
163         mono-mlist.c            \
164         mono-mlist.h            \
165         mono-perfcounters.c     \
166         mono-perfcounters.h     \
167         mono-perfcounters-def.h \
168         mono-ptr-array.h        \
169         mono-route.c            \
170         mono-route.h            \
171         mono-wsq.c              \
172         mono-wsq.h              \
173         monitor.h               \
174         nacl-stub.c             \
175         normalization-tables.h  \
176         number-formatter.h      \
177         object-internals.h      \
178         opcodes.c               \
179         socket-io.c             \
180         socket-io.h             \
181         process.c               \
182         process.h               \
183         profiler.c              \
184         profiler-private.h      \
185         rand.h                  \
186         rand.c                  \
187         remoting.h              \
188         remoting.c              \
189         runtime.c               \
190         mono-security.c         \
191         security.h              \
192         security-core-clr.c     \
193         security-core-clr.h     \
194         security-manager.c      \
195         security-manager.h      \
196         string-icalls.c         \
197         string-icalls.h         \
198         sysmath.h               \
199         sysmath.c               \
200         tabledefs.h             \
201         threads.c               \
202         threads-types.h         \
203         threadpool.c            \
204         threadpool.h            \
205         threadpool-internals.h  \
206         threadpool-ms.c \
207         threadpool-ms.h \
208         threadpool-ms-io.c      \
209         threadpool-ms-io.h      \
210         tpool-poll.c    \
211         verify.c                \
212         verify-internals.h      \
213         wrapper-types.h \
214         reflection-internals.h  \
215         file-mmap-posix.c       \
216         file-mmap-windows.c     \
217         file-mmap.h     \
218         object-offsets.h        \
219         abi-details.h   \
220         metadata-cross-helpers.c        \
221         seq-points-data.h       \
222         seq-points-data.c
223
224
225 # These source files have compile time dependencies on GC code
226 gc_dependent_sources = \
227         appdomain.c     \
228         domain.c        \
229         gc.c            \
230         monitor.c       \
231         mono-hash.c     \
232         object.c        \
233         reflection.c
234
235 boehm_sources = \
236         boehm-gc.c
237
238 sgen_sources = \
239         sgen-os-posix.c         \
240         sgen-os-mach.c          \
241         sgen-os-win32.c         \
242         sgen-gc.c               \
243         sgen-internal.c         \
244         sgen-marksweep.c        \
245         sgen-los.c              \
246         sgen-protocol.c \
247         sgen-bridge.c           \
248         sgen-bridge.h           \
249         sgen-old-bridge.c               \
250         sgen-new-bridge.c               \
251         sgen-tarjan-bridge.c            \
252         sgen-toggleref.c                \
253         sgen-toggleref.h                \
254         sgen-gc.h               \
255         sgen-conf.h             \
256         sgen-archdep.h          \
257         sgen-cardtable.c        \
258         sgen-cardtable.h        \
259         sgen-pointer-queue.c    \
260         sgen-pointer-queue.h    \
261         sgen-pinning.c  \
262         sgen-pinning.h  \
263         sgen-pinning-stats.c    \
264         sgen-workers.c  \
265         sgen-workers.h  \
266         sgen-gray.c     \
267         sgen-gray.h     \
268         sgen-major-copy-object.h \
269         sgen-minor-copy-object.h \
270         sgen-copy-object.h \
271         sgen-marksweep-scan-object-concurrent.h \
272         sgen-minor-scan-object.h \
273         sgen-marksweep-drain-gray-stack.h       \
274         sgen-protocol.h         \
275         sgen-protocol-def.h             \
276         sgen-scan-object.h      \
277         sgen-nursery-allocator.c        \
278         sgen-hash-table.c       \
279         sgen-hash-table.h       \
280         sgen-descriptor.c               \
281         sgen-descriptor.h               \
282         sgen-alloc.c            \
283         sgen-debug.c            \
284         sgen-simple-nursery.c   \
285         sgen-split-nursery.c    \
286         sgen-memory-governor.c  \
287         sgen-memory-governor.h  \
288         sgen-stw.c                              \
289         sgen-fin-weak-hash.c    \
290         sgen-layout-stats.c     \
291         sgen-layout-stats.h     \
292         sgen-qsort.c    \
293         sgen-qsort.h    \
294         sgen-thread-pool.c      \
295         sgen-thread-pool.h      \
296         sgen-tagged-pointer.h
297
298 libmonoruntime_la_SOURCES = $(common_sources) $(gc_dependent_sources) $(null_gc_sources) $(boehm_sources)
299 libmonoruntime_la_CFLAGS = $(BOEHM_DEFINES)
300 libmonoruntime_la_LIBADD = libmonoruntime-config.la
301
302 libmonoruntimesgen_la_SOURCES = $(common_sources) $(gc_dependent_sources) $(sgen_sources)
303 libmonoruntimesgen_la_CFLAGS = $(SGEN_DEFINES)
304 libmonoruntimesgen_la_LIBADD = libmonoruntime-config.la
305
306 libmonoruntime_static_la_SOURCES = $(libmonoruntime_la_SOURCES)
307 libmonoruntime_static_la_LDFLAGS = -static
308 libmonoruntime_static_la_CFLAGS = $(BOEHM_DEFINES)
309 libmonoruntime_static_la_LIBADD = $(bundle_obj) $(libmonoruntime_la_LIBADD)
310
311 libmonoruntimesgen_static_la_SOURCES = $(libmonoruntimesgen_la_SOURCES)
312 libmonoruntimesgen_static_la_LDFLAGS = -static
313 libmonoruntimesgen_static_la_CFLAGS = $(SGEN_DEFINES)
314 libmonoruntimesgen_static_la_LIBADD = $(libmonoruntimesgen_la_LIBADD)
315
316 libmonoruntimeincludedir = $(includedir)/mono-$(API_VER)/mono/metadata
317
318 libmonoruntimeinclude_HEADERS = \
319         assembly.h              \
320         attrdefs.h              \
321         appdomain.h             \
322         blob.h                  \
323         class.h                 \
324         debug-helpers.h         \
325         debug-mono-symfile.h    \
326         threads.h               \
327         environment.h           \
328         exception.h             \
329         image.h                 \
330         loader.h                \
331         metadata.h              \
332         mono-config.h           \
333         mono-debug.h            \
334         mono-gc.h               \
335         sgen-bridge.h           \
336         object.h                \
337         opcodes.h               \
338         profiler.h              \
339         reflection.h            \
340         row-indexes.h           \
341         tokentype.h             \
342         verify.h                
343
344 if DTRACE_G_REQUIRED
345
346 PEDUMP_DTRACE_OBJECT = pedump-dtrace.$(OBJEXT)
347
348 pedump-dtrace.$(OBJEXT): $(top_srcdir)/data/mono.d libmonoruntime.la ../io-layer/libwapi.la ../utils/libmonoutils.la
349         DTRACE="$(DTRACE)" DTRACEFLAGS="$(DTRACEFLAGS)" AR="$(AR)" $(SHELL) $(top_srcdir)/data/dtrace-prelink.sh \
350         --pic pedump-dtrace.$(OBJEXT) $(top_srcdir)/data/mono.d libmonoruntime.la ../io-layer/libwapi.la ../utils/libmonoutils.la
351
352 else
353 PEDUMP_DTRACE_OBJECT = 
354 endif
355
356 if SHARED_MONO
357 if SUPPORT_BOEHM
358 pedump_SOURCES =                \
359         pedump.c
360
361 pedump_LDADD = libmonoruntime.la ../io-layer/libwapi.la ../utils/libmonoutils.la \
362         $(LIBGC_LIBS) $(GLIB_LIBS) -lm $(LIBICONV) $(PEDUMP_DTRACE_OBJECT)
363
364 if PLATFORM_DARWIN
365 pedump_LDFLAGS=-framework CoreFoundation -framework Foundation
366 endif
367 endif
368 endif
369
370 EXTRA_DIST = $(win32_sources) $(unix_sources) $(null_sources) runtime.h \
371                 tpool-poll.c tpool-epoll.c tpool-kqueue.c